error while loading shared libraries的解決方法
者 icq 21:03 | 靜態連結網址 | 迴響 (0) | 引用 (1) | 點閱次數 (270) | Programming
行程式時,如此遇到像下列這種錯誤:
./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這個目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。
將 /etc/ld.so.conf存檔後,還要執行「/sbin/ldconfig –v」來更新一下才會生效。
者 icq 21:03 | 靜態連結網址 | 迴響 (0) | 引用 (1) | 點閱次數 (270) | Programming
行程式時,如此遇到像下列這種錯誤:
./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這個目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。
將 /etc/ld.so.conf存檔後,還要執行「/sbin/ldconfig –v」來更新一下才會生效。
本文详细介绍了如何解决编程过程中遇到的errorwhileloadingsharedlibraries错误,通过修改/etc/ld.so.conf文件并执行/sbin/ldconfig-v来更新配置,从而在指定目录下找到并加载所需的.so文件。
1447

被折叠的 条评论
为什么被折叠?



