0
我想在我的Mac上使用CLion(CMake)運行openssl。無法在macOS-Sierra上使用openssl
安裝了OpenSSL與自制
brew install openssl
但還是克利翁是無法找到的OpenSSL。在過去有可能使用
brew link openssl
但似乎今天這是拒絕自制。
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
然後我用下面的克利翁(的CMakeLists.txt)cmake的選項
set(I "/usr/local/opt/openssl/include")
set(L "/usr/local/opt/openssl/lib")
include_directories(${I})
但我仍然得到:
Undefined symbols for architecture x86_64:
"_EVP_DigestSignFinal", referenced from:
Undefined symbols for architecture x86_64:
"_EVP_DigestSignFinal", referenced from:
OpenSSL::signMsg(Buffer, Buffer, SignOptions) in libMyLib.a(ssl_state.cpp.o)
OpenSSL::signMsg(Buffer, Buffer, SignOptions) in libMyLib.a(ssl_state.cpp.o)
幾乎所有我能找到這個主題是對老年版本的macOS,但Apple已經從openssl 0.9.8中刪除了開發頭文件,所以很多指南都不再適用。
另請參見[家釀拒不鏈接的OpenSSL(http://stackoverflow.com/q/38670295),[更新的OpenSSL與自制OS X](HTTP:/ /stackoverflow.com/q/15185661),[如何安裝最新版本的openssl Mac OS X El Capitan](http://stackoverflow.com/q/35129977),[如何在OS X中升級OpenSSL?](http ://apple.stackexchange.com/q/126830),[使用HomeBrew的Openssl安裝失敗](http://superuser.com/q/486389)等 – jww