在执行程序时遇到“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使设置生效,即可解决问题。