使用 Python3.10 和 OpenSSL-1.1 编译 C:未定义符号“OPENSSL

使用 Python3.10 和 OpenSSL-1.1 编译 C:未定义符号“OPENSSL,第1张

使用 Python3.10 和 OpenSSL-1.1 编译 C:未定义符号“OPENSSL

nginx/unit 的配置脚本失败,因为它无法编译如下所示的 python 扩展代码:

#include 

int main() {
  Py_Initialize();
  return 0;
}

我使用的是用 openssl-1.1.1 编译的 python3.10。编译给出了几个符号未找到错误,包括“OPENSSL_sk_num”。似乎符号在 libcrypto 中,我已在编译命令中手动链接了它。

我是否需要再次编译 Python 以便在 libpython.a 中静态链接 libcrypto 和 libssl?下面是完整的编译命令。

cc -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -I/home/shared/Builds/Python-3.1
0.0/include/python3.10 -I/home/shared/Builds/Python-3.10.0/include/python3.10 -o build/autotest build/autotest.c -L/home/shared/Builds/Python-3.10.0/lib/python3.10/config-3.10 -L/home/shared/Buil
ds/Python-3.10.0/lib -lcrypto -lssl  -lpython3.10 -lpthread -lutil -lm -lm

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5682398.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存