栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用 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
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/681823.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号