解决openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No s
2016-12-27
error while loading shared libraries的解决方法
执行程式时,如此遇到像下列这种错误:
./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory
那就表示系统不知道xxx.so放在哪个目录下。
这个时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。
一般而言,有很多so档会在/usr/local/lib这个目录下,所以在/etc/ld.so.conf中加入/usr/local/lib这一行,可以解决此问题。(比如安装路径是/usr/local/openssl 则此处为/usr/local/openssl/lib)
将/etc/ld.so.conf存档后,还要执行
/sbin/ldconfig –v来更新一下才会生效