您的位置:首页 > 移动开发 > Objective-C

error while loading shared libraries的解决方法2则(转)

2011-10-18 14:55 721 查看
执行程式时,如此遇到像下列这种错误: 

./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory./tests: error while loading shared libraries:
xxx.so.0:cannot open shared object file: No such file or directory 

那就表示系統不知道xxx.so 放在哪個目錄下。那就表示系统不知道xxx.so放在哪个目录下。 

這個時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。这个时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。

一般而言,有很多so檔會在/usr/local/lib這個目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。一般而言,有很多so档会在/usr/local/lib这个目录下,所以在/etc/ld.so.conf中加入/usr/local/lib这一行,可以解决此问题。

將/etc/ld.so.conf存檔後,還要執行「/sbin/ldconfig –v」來更新一下才會生效。将/etc/ld.so.conf存档后,还要执行「/sbin/ldconfig –v」来更新一下才会生效。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  file object