root@760501de936d:/home/project/build# ldconfig -p | grep ssl
libssl.so.1.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl.so.1.0.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
libssl.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so
My project is trying to link with OpenSSL. How can I force it to use libssl.so.1.1
?
I'm using cmake
find_library(LIB_SSL ssl)
then
target_link_libraries(h264_decoder_cli PRIVATE
${LIB_SSL} ${LIB_CRYPTO} ...)
however I get things like
tls_openssl.c:(.text+0x3a8): undefined reference to `OPENSSL_init_ssl'
I don't know why but only the version 1.1 has this symbol
root@760501de936d:/home/project/build# nm -D /usr/lib/x86_64-linux-gnu/libssl.so | grep OPENSSL_init_ssl
root@760501de936d:/home/project/build# nm -D /usr/lib/x86_64-linux-gnu/libssl.so.1.1 | grep OPENSSL_init_ssl
0000000000033ff0 T OPENSSL_init_ssl
I checked how cmake is compiling and it's simply putting -lssl -lcrypto