Make

libssl 未定義對符號“SSL_load_error_strings@@OPENSSL_1.0.0”的引用

  • June 28, 2017

使用以下 CMakeLists.txt(我試圖將其剪斷 AMAP)

https://gist.github.com/pbertoni/29200833dc562ab6ee2c

make我在連結時收到此錯誤:

/usr/bin/ld: CMakeFiles/blockmon.dir/bin/blockmon.cpp.o: undefined reference to symbol 'SSL_load_error_strings@@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

/usr/bin/ld: CMakeFiles/blockmonWithXmlRPC.dir/bin/blockmonWithXmlRPC.cpp.o: undefined reference to symbol 'SSL_load_error_strings@@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

對於 Cmake 所針對的兩個執行檔中的每一個。輸出:

ldd /lib/x86_64-linux-gnu/libssl.so.1.0.0

linux-vdso.so.1 =>  (0x00007ffc5a1f4000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fad78c52000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fad7888d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fad78688000)
/lib64/ld-linux-x86-64.so.2 (0x00007fad792bd000)

我正在使用Ubuntu 14.04.2 LTS x64. 請注意,在Debian 7.8 x64系統上它可以工作

我試圖在這個要點上截取可執行程式碼。

https://gist.github.com/pbertoni/7c82c12683d4491339c1

開發人員刪除了該符號。請參閱https://github.com/openssl/openssl/blob/72257204bd2a88773461150765dfd0e0a428ee86/include/openssl/ssl.h#L1495您需要做的是添加#define OPENSSL_API_COMPAT 0x0908某處以將符號定義為宏。

引用自:https://unix.stackexchange.com/questions/195974