编译时没有 OpenSSL 支持错误
No OpenSSL Support Error When Compiling
最近在 Xcode 7 中删除了 OpenSSL,我发现自己必须为使用它的旧程序手动构建库。我有一个据称构建库的 Xcode 项目(libcrypto.a 和 libssl.a 已成功创建),但是在编译旧程序时,出现错误:
"no OpenSSL thread support"
这是由预处理器检查引发的错误引起的:
...
#define OPENSSL_THREAD_DEFINES
#include <openssl/opensslconf.h>
#ifndef OPENSSL_THREADS
#error no OpenSSL thread support
#endif
...
正在找到 opensslconf.h 文件,但显然 OPENSSL_THREADS 没有被定义。这应该包含在该文件的某处吗?是不是我在构建 OpenSSL 库时出现了某种配置错误?
非常感谢对此的任何帮助。提前致谢!
在分别为 OpenSSL 和 Curl 配置构建时可以使用的选项之一中找到了答案:
./Configure darwin64-x86_64-cc
和
./configure --with-darwinssl
最近在 Xcode 7 中删除了 OpenSSL,我发现自己必须为使用它的旧程序手动构建库。我有一个据称构建库的 Xcode 项目(libcrypto.a 和 libssl.a 已成功创建),但是在编译旧程序时,出现错误:
"no OpenSSL thread support"
这是由预处理器检查引发的错误引起的:
...
#define OPENSSL_THREAD_DEFINES
#include <openssl/opensslconf.h>
#ifndef OPENSSL_THREADS
#error no OpenSSL thread support
#endif
...
正在找到 opensslconf.h 文件,但显然 OPENSSL_THREADS 没有被定义。这应该包含在该文件的某处吗?是不是我在构建 OpenSSL 库时出现了某种配置错误?
非常感谢对此的任何帮助。提前致谢!
在分别为 OpenSSL 和 Curl 配置构建时可以使用的选项之一中找到了答案:
./Configure darwin64-x86_64-cc
和
./configure --with-darwinssl