Okay, I need to use md5() function from OpenSSL library, but when I compile gcc gives me an error - "undefined reference to md5". I tried few things, which I found in different StackOverFlow questions, but still no effect.
First of all I installed packages (Ubuntu 13.04):
sudo apt-get install openssl
sudo apt-get install libssl-dev
In my source I included openssl/md5 and I tried to compile everything this way:
gcc main.c -lssl -lcrypto
or
gcc main.c -L/home/usr/lib -lssl -lcrypto
What am I missing? Please help.
libssl-devand compiling withgcc main.c -lssl -lcrypto, things should have worked. That's becauseapt-getputs the libraries in/usr/liband the compiler/linker could find them. So you have another problem that's not readily apparent. Clean your project and start again or show us the make command. - jww-ldland-lpthread, too. Add them after-lssl-lcrypto. - jww#include <openssl/md5.h>- francis