【发布时间】:2017-07-21 17:56:43
【问题描述】:
我想在我的 Mac 上使用 CLion (CMake) 运行 openssl。
用自制软件安装 openssl
brew install openssl
但 CLion 仍然无法找到 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
然后我在 CLion (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 中删除了开发头文件,所以很多指南都不再适用了。
【问题讨论】:
标签: macos cmake openssl homebrew macos-sierra