I am using ubuntu 20 and i am trying to compile my C code which uses md5 function from "<openssl/md5.h>" into a static binary.
The problem is that I get an error: undefined reference to MD5
.
if i compile it without static it works ok.
I have tried the following methods and same error:
clang --static -I/usr/include/openssl -L/lib/x86_64-linux-gnu -lcrypto -lssl binary.c -o binary_out
clang --static -I/usr/include/openssl -L/lib/x86_64-linux-gnu -lcrypto binary.c -o binary_out
clang --static -I/usr/include/openssl -L/usr/lib/x86_64-linux-gnu -lcrypto binary.c -o binary_out