您的位置:首页 > 运维架构 > Linux

error while loading shared libraries错误的原因及解決方法

2017-12-04 10:36 495 查看
在linux下运行程序时,发现了
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
这个目录底下,去这个目录底下找,果然发现自己所需要的
.so
文件。

所以,在
/etc/ld.so.conf
中加入
/usr/local/lib
这一行,保存之后,再运行:
/sbin/ldconfig –v
更新一下配置即可。

参考这里
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux
相关文章推荐