error while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory .

时间:2023-03-08 18:14:47

转载:http://www.eefocus.com/pengwr/blog/2012-02/235057_baf52.html

此时你可以locate libXXX.so.x 一下,查看系统里是否有该文件,大部分情况是该文件存在。然后把libXXX.so.3所在的目录加入到 /etc/ld.so.conf 中。
如果发现libXXX.so.x不存在,你可能没安装包含库的程序。一般google一下“XXX linux”就能找到相应的软件.

如,我执行一个fedora10 的内核编译配置时,输入make xconfig,出现以下提示:error while loading
shared libraries: libqt-mt.so.3: cannot open shared object file: No such
file or directory .

[peng@localhost /]$ locate libqt-mt.so.3
/usr/lib/qt-3.3/lib/libqt-mt.so.3
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3.8
[peng@localhost ~]$ cd /etc
[peng@localhost etc]$ sudo gedit ld.so.conf   (添加 /usr/lib/qt-3.3/lib)
[peng@localhost etc]$ sudo ldconfig

再次编译,成功

补充:

查看是否有该文件的方法:

  1.locate libXXX.so.x

  2.find / -name libXXX.so.x