2022-07-12 undefined reference to symbol 'OPENSSL_init_ssl@@OPENSSL_1_1_0'

编译代码报错如下:

/usr/bin/ld: /home/×××/lib/Poco/libPocoCrypto.a(OpenSSLInitializer.o): undefined reference to symbol 'OPENSSL_init_ssl@@OPENSSL_1_1_0'

/usr/bin/ld: /usr/local/lib/libssl.so.1.1: error adding symbols: DSO missing from command line


以为是openssl或者poco编译不对,各种版本组合,始终没有解决,我使用的openssl是1.1.1,为啥提示是OPENSSL_1_1_0呢,想不通。


后来找到如下连接,解决了。

https://blog.csdn.net/jun2016425/article/details/78860674


编译时尝试加上:

-lssl -lcrypto

你可能感兴趣的:(2022-07-12 undefined reference to symbol 'OPENSSL_init_ssl@@OPENSSL_1_1_0')