详细说明如何解决error while loading shared libraries: libGL.so.1: cannot open shared object file……
2017-06-14 10:35
603 查看
原本运行的好好的程序,闲置几天后再用,make的时候突然表示
“error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file”
表示找不到动态库libGL.so.1!
有可能你的情况是libXX.so.X……找不到各种其他的库,不局限的,解决方式都一样,把以下操作过程中库名换过来就行
遇到了这个情况,我首先查了一下资料,这个博客里说明了可能出现这种问题的原因以及解决方式:
http://blog.csdn.net/sahusoft/article/details/7388617
想要补充两点:
1,上面文章中说的两个原因,一个是没有安装正确的库文件,另一个是库文件路径不对。
那么如何判断系统中有没有安装对应库文件呢?
命令型模式输入:sudo updatedb (更新数据库,一般与locate一起使用,基本是固定搭配)
locate -b '\libXX.so.X' (该语句十分好用!可以找到指定文件所在绝对路径,当然是要系统中有这个文件啦)
废话一句,上面这两个语句是真好使,每次想找什么文件都用这个组合!
如果没有返回任何地址,说明系统里没有这个库文件,需要自行安装;
如果返回了该库文件的地址,说明系统中已经安装。若是地址显示是 默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下,
如何查看/etc/ld.so.conf内所列的目录?
命令行模式输入:cat /etc/ld.so.conf
就会返回动态库配置文件所列目录
若是地址显示是 默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下,那么就只需要执行ldconfig.
命令型模式输入:sudo ldconfig
否则,需要先将库文件所在绝对地址写入到配置文件中,再ldconfig:
命令型模式输入:sudo echo "/.../libXX.so.X'" >> /etc/ld.so.conf
sudo ldconfig
2,原博客中都没有加sudo,这样可能不够权限,而你又可能没注意到返回信息是“permission denied”,搞半天还是没能解决问题,所以我在操作过程中都加了sudo,以防万一!
根据以上步骤,问题得到解决!哈哈~ 你呢?
另外关于ldconfig的作用:
http://wangqiaowqo.iteye.com/blog/1283887
下拉看看它的作用会有更好的理解!
“error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file”
表示找不到动态库libGL.so.1!
有可能你的情况是libXX.so.X……找不到各种其他的库,不局限的,解决方式都一样,把以下操作过程中库名换过来就行
遇到了这个情况,我首先查了一下资料,这个博客里说明了可能出现这种问题的原因以及解决方式:
http://blog.csdn.net/sahusoft/article/details/7388617
想要补充两点:
1,上面文章中说的两个原因,一个是没有安装正确的库文件,另一个是库文件路径不对。
那么如何判断系统中有没有安装对应库文件呢?
命令型模式输入:sudo updatedb (更新数据库,一般与locate一起使用,基本是固定搭配)
locate -b '\libXX.so.X' (该语句十分好用!可以找到指定文件所在绝对路径,当然是要系统中有这个文件啦)
废话一句,上面这两个语句是真好使,每次想找什么文件都用这个组合!
如果没有返回任何地址,说明系统里没有这个库文件,需要自行安装;
如果返回了该库文件的地址,说明系统中已经安装。若是地址显示是 默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下,
如何查看/etc/ld.so.conf内所列的目录?
命令行模式输入:cat /etc/ld.so.conf
就会返回动态库配置文件所列目录
若是地址显示是 默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下,那么就只需要执行ldconfig.
命令型模式输入:sudo ldconfig
否则,需要先将库文件所在绝对地址写入到配置文件中,再ldconfig:
命令型模式输入:sudo echo "/.../libXX.so.X'" >> /etc/ld.so.conf
sudo ldconfig
2,原博客中都没有加sudo,这样可能不够权限,而你又可能没注意到返回信息是“permission denied”,搞半天还是没能解决问题,所以我在操作过程中都加了sudo,以防万一!
根据以上步骤,问题得到解决!哈哈~ 你呢?
另外关于ldconfig的作用:
http://wangqiaowqo.iteye.com/blog/1283887
下拉看看它的作用会有更好的理解!
相关文章推荐
- 解决 error while loading shared libraries: libghttp.so.1: cannot open shared object file
- error while loading shared libraries: libnet.so.9: cannot open shared object file: No such **解决方法
- rpm: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory解决办法
- 解决openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No s
- 错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
- 错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
- error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: 的解决办法
- 解决 Linux error while loading shared libraries: cannot open shared object file: No such file or directory
- 解决./exam5-5: error while loading shared libraries: libdemo.so: cannot open shared object file:
- 解决error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No su
- 解决error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No su
- 解决Linux: error while loading shared libraries: ...: cannot open shared object file: No such file or directory 类似问题
- 解决aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: Nosuchfile
- Atlas系列一:【已解决】error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory
- 错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
- 解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
- 解决error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No su
- error while loading shared libraries: libevent-1.3.so.1:cannot open shared object file :No such file or directory解决方法
- 错误解决 error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such fil
- 错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file