error while loading shared libraries错误处理

在linux下运行程序时,发现了error while loading shared libraries这种错误,一时间不知道解决办法,在网上搜索,终于解决了:linux

 

./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所在的目录。
spa

通常而言,有不少的so会存放在/usr/local/lib这个目录底下,去这个目录底下找,果真发现本身所须要的.so文件。orm

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

相关文章
相关标签/搜索