undefined reference to `BIO_f_zlib‘ openssl编译报错
程序员文章站
2022-03-04 23:51:46
...
undefined reference to `BIO_f_zlib’
问题描述
openssl升级过程中的编译时报错
enc.c:(.text+0xdec): undefined reference to `BIO_f_zlib'
collect2: error: ld returned 1 exit status
make[1]: *** [apps/openssl] Error 1
make[1]: Leaving directory `/usr/local/src/openssl-1.1.1h'
make: *** [all] Error 2
解决方案
make clean
make //重新编译
openssl 升级至 openssl-1.1.1h 过程
1.下载指定版本的openssl软件
在下面网址:https://www.openssl.org/source/下载 后面的版本号可以换
[aaa@qq.com ~]# wget hhttps://www.openssl.org/source/openssl-1.1.1h.tar.gz
2.编译安装
tar xfz /tmp/openssl-1.1.1e.tar.gz -C /opt/ && cd /opt/openssl-1.1.1h/
./config shared zlib
make && make install
3.配置
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak # 如报mv: cannot stat ‘/usr/include/openssl’: No such file or directory可忽略此步
find / -name openssl
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
echo "/usr/local/lib64/" >> /etc/ld.so.conf
ldconfig
openssl version -a
4.验证
openssl version
升级过程中可能会出现缺少zlib.h文件
故附zlib源码安装步骤
1、zlib源码包下载
zlib地址:http://www.zlib.net/
2、zlib标准编译、安装指导:
将包手动上传至/tmp目录下
mv /tmp/zlib-1.2.11.tar.gz /usr/local/src/ && cd /usr/local/src/ && tar zxf zlib-1.2.11.tar.gz && cd zlib-1.2.11
cd /usr/local/src/zlib-1.2.11
构建静态库
.../zlib-1.2.11]# ./configure
.../zlib-1.2.11]# make test
.../zlib-1.2.11]# make install
构建共享库
.../zlib-1.2.11]# make clean
.../zlib-1.2.11]# ./configure --shared
.../zlib-1.2.11]# make test
.../zlib-1.2.11]# make install
.../zlib-1.2.11]# cp zutil.h /usr/local/include
.../zlib-1.2.11]# cp zutil.c /usr/local/include
上一篇: Pygame学习01_初相见
下一篇: 局域网IP访问出现Forbidden You don‘t have permission to access * on this server问题解决-找对正确的配置文件进行修改
推荐阅读
-
Windows编译OpenCV4Android解决undefined reference to std错误
-
ndk编译error: undefined reference to ‘fegetenv‘
-
编译内核时报错:scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h: No such file or directory
-
fcgi-2.4.0编译出现echo-cpp.o: undefined reference to symbol ‘FCGX_InitRequest‘
-
Android NDK 报错:undefined reference to ‘main‘(invalid character)解决办法
-
React Native 0.26.2编译报错Undefined symbols for architecture x86_64
-
React Native 0.26.2编译报错Undefined symbols for architecture x86_64
-
【使用 libssh】编译失败, undefined reference to ‘ssh_new‘, undefined reference to ‘ssh_free‘
-
"undefined reference to `WinMain' collect2.exe" C++ / vscode报错记录
-
Android studio opencv报错undefined reference to 'cv::imwrite(cv::String const&, c