How to fix C error: undefined reference to MD5_Update

When linking against OpenSSL, you may see:

md5_link_error.txt
undefined reference to `MD5_Update'

Ensure you link against the correct OpenSSL libraries, e.g.:

gcc_openssl_example.sh
gcc -o myprog myprog.c -lcrypto

Or with pkg-config:

pkgconfig_openssl.sh
gcc -o myprog myprog.c $(pkg-config --cflags --libs openssl)

Check out similar posts by category: C/C++