Problem using library libssl
Hi all,
I have a problem about gcc not finding a library and its symbols. I link
my very simple test program against libssl using -lssl and the linker
emit a lot of errors about symbols not found. These are symbols from
libcrypto.so, but they should be automatically found since libssl.so
require libcrypto.so (it is listed by "ldd /usr/lib/libssl.so").
Please note my program does only use a symbol from libssl and nothing
from libcrypto. This is the source:
char SSL_library_init();
int main ()
{
return SSL_library_init();
}
I know that on a fresh debian installation this works without any
problem.
The error I get are:
$ gcc -o conftest conftest.c -lssl
/usr/lib/gcc/i486-linux-gnu/4.6.1/../../../../lib/libssl.so: undefined reference to `BIO_pop@OPENSSL_1.0.0'
/usr/lib/gcc/i486-linux-gnu/4.6.1/../../../../lib/libssl.so: undefined reference to `EVP_CipherInit_ex@OPENSSL_1.0.0'
/usr/lib/gcc/i486-linux-gnu/4.6.1/../../../../lib/libssl.so: undefined reference to `BUF_memdup@OPENSSL_1.0.0'
/usr/lib/gcc/i486-linux-gnu/4.6.1/../../../../lib/libssl.so: undefined reference to `EVP_MD_CTX_copy@OPENSSL_1.0.0'
/usr/lib/gcc/i486-linux-gnu/4.6.1/../../../../lib/libssl.so: undefined reference to `sk_free@OPENSSL_1.0.0'
[... many other similar ...]
I get the same error with gcc-4.4, gcc-4.5, and gcc-4.6. May this be due
to same gcc configuration file? Or is it more probably a linker problem
(maybe some files in /etc/ld.so.conf.d/)?
Any idea about possible solutions?
Thanks,
Giuseppe
Reply to: