安装openssl报错openssl: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1' not found

在ubuntu上尝试编译安装最新的openssl1.1.1的时候报错:
openssl: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version OPENSSL_1_1_1’ not found (required by openssl)
查了一下,主要是LD_LIBRARY_PATH这个环境变量没有指定导致openssl正在使用旧的系统OpenSSL库
解决方法:

$ echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
$ export LD_LIBRARY_PATH=/usr/local/lib

假如你安装openssl到默认位置的话
在这里插入图片描述

小贴士:在1.1.0或以上版本的时候,最好显示地指定--prefix--openssldir,之前我只是直接默认地./config.除此以外还需要设置额外的CFLAGS才能正常地运行,举个栗子./config --prefix=/usr --openssldir=/usr --libdir=lib shared zlib-dynamic -Wl,-R,'$(LIBRPATH)' -Wl,--enable-new-dtags

参考资料
解决方法
安装指南

你可能感兴趣的:(openssl)