首页 技术 正文
技术 2022年11月14日
0 收藏 699 点赞 3,935 浏览 1801 个字

0 现象

在 Arch 下编译 OpenWRT (15.05) cmcurl 时报错:

[ 28%] Linking C executable LIBCURL
lib/libcmcurl.a(openssl.c.o): In function `cert_stuff`:
openssl.c:(.text+0x97a): undefined reference to `sk_num`
openssl.c:(.text+0x99a): undefined reference to `sk_pop`
openssl.c:(.text+0xa21): undefined reference to `sk_num`
openssl.c:(.text+0xa62): undefined reference to `sk_pop_free`
lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_init`:
openssl.c:(.text+0xf74): undefined reference to `SSL_load_error_strings`
openssl.c:(.text+0xf79): undefined reference to `SSL_library_init`
openssl.c:(.text+0xf89): undefined reference to `OPENSSL_add_all_algorithms_noconf`
lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_cleanup`:
openssl.c:(.text+0xfad): undefined reference to `EVP_cleanup`
openssl.c:(.text+0xfb2): undefined reference to `ERR_free_strings`
lib/libcmcurl.a(openssl.c.o): In function `verifyhost`:
openssl.c:(.text+0x1a7a): undefined reference to `sk_num`
openssl.c:(.text+0x1a9a): undefined reference to `sk_value`
lib/libcmcurl.a(openssl.c.o): In function `ossl_connect_step1`:
openssl.c:(.text+0x29a5): undefined reference to `SSLv23_client_method`
lib/libcmcurl.a(openssl.c.o): In function `X509V3_ext`:
openssl.c:(.text+0x3a77): undefined reference to `sk_num`
openssl.c:(.text+0x3aab): undefined reference to `sk_value`
openssl.c:(.text+0x3d5c): undefined reference to `sk_num`
lib/libcmcurl.a(openssl.c.o): In function `get_cert_chain`:
openssl.c:(.text+0x3fe2): undefined reference to `sk_num`
openssl.c:(.text+0x4061): undefined reference to `sk_value`
lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_version`:
openssl.c:(.text+0x61c3): undefined reference to `SSLeay`
collect2: error: ld returned 1 exit status

看得出来应该是相关库未链接成功。

1 解决方案

查阅了相关文档,发现这些方法是在老的 OpenSSL 中存在的,首先先安装老版本:

$ sudo pacman -S openssl-1.0

使用软链接的方式,更改默认库的指向使用老版本即可(若已有软链接,需要先删除),如:

# rm libcrypto.so
# rm libssl.so
# ln -s libcrypto.so.1.0.0 libcrypto.so
# ln -s libssl.so.1.0.0 libssl.so
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,085
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,560
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,409
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,182
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,819
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,902