OpenSSL 1.0.1f and "undefined reference to symbol 'SSL_state@@OPENSSL_1.0.0"

12k views Asked by At

This morning I updated my OpenSSL version to the 1.0.1f, while compiling the project on which i am currently working i got this OpenSSL error from the linker:

/usr/bin/ld: janus-dtls.o: undefined reference to symbol 'SSL_state@@OPENSSL_1.0.0' //lib/x86_64-linux-gnu/libssl.so.1.0.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

I went to find clues on the internet and the only thing i found is that i need to compile the project with -lssl and -lcrypto. But the thing is that i allready do :

./Makefile:598:JANUS_LIBS = -pthread -L/usr/local/lib -lnice -lgthread-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ljansson -lssl -lcrypto -lsofia-sip-ua

So i guessed i will ask DPKG maybe i'am forgeting something. Here is the answer :

$ pkg-config --libs openssl

-L/usr/local/lib -lssl -lcrypto 

Which is exactly what i do.

Do anyone already encountered this error and manged to fix it ?

Or maybe am i doing something wrong i can't see ?

Any help would be much appreciated.

1

There are 1 answers

0
Alessandro Rossi On

Symbols requests are made BEFORE linking them, so the order of libs is strict.

If LibA has a symbol that LibB needs the order will be :

gcc mod1.o mod2.o -lLibA  -lLibB  

Double check that all the libraries in Makefile aren't missing.