error while loading shared libraries的解决办法

来源:互联网 发布:大数据时代下的创新 编辑:程序博客网 时间:2024/04/26 04:05

在执行程序时遇到“error while loading shared libraries xxx.so.0:cannot open shared object file: No such file or directory”这种错误时因为程序找不到xxx.so.0放在哪个目录下面。

 

这时需要在/etc/ld.so.conf文件中加入xxx.so.0所在的目录。

 

在/etc/ld.so.conf文件中直接另起一行,写入xxx.so.0所在的目录即可,例如“/usr/local/lib”。

 

保存ld.so.conf文件后在命令行中执行/sbin/ldconfig –v使设置生效,即可解决问题。

 

 

原创粉丝点击