[英]Link OpenSSL to CLion on Mac
当我输入
brew install openssl
brew link --force openssl
我想将此库链接到我的 CLion 项目,但如果 force ling 不起作用,我该如何链接它? 我想要做的只是在我的 CLion 项目中#include <openssl/evp.h>
。 clion 中的默认包含文件夹是什么?
尝试“brew list openssl”,您将看到默认的包含文件夹
要在CMakeLists.txt
链接 OpenSSL,根据通过brew
安装的 OpenSSL 版本添加以下行:
include_directories(/usr/local/Cellar/openssl@1.1/1.1.1d/include/)
target_link_libraries(openss_hmac /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.a)
include_directories
应该使#include <openssl/evp.h>
找到没有编译问题的头文件。
target_link_libraries
链接库,上面链接libcrypto.a
,我假设您想使用 OpenSSL 中的加密函数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.