您现在的位置: 万盛学电脑网 >> 操作系统 >> Linux教程 >> 正文

Linux执行程序时提示error while loading shared怎么办?

作者:佚名    责任编辑:admin    更新时间:2022-06-22

  Linux在执行某些程序的时候,居然出现了error while loading shared libraries错误提示,相信很多朋友都有遇到这个问题,其实这个问题不难解决,随小编一起来了解下吧。

Linux执行程序时提示error while loading shared怎么办?

  解决方法:

  。/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这个目录底下,去这个目录底下找,果然发现自己所需要的.so文件。

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

  上面就是Linux执行程序时提示error while loading shared libraries的解决方法,如果你遇到了一样的问题,可在/etc/ld.so.conf中加入xxx.so所在的目录,再更新下配置。