cannot open shared object file: No such file or directory 解决方法

来源:互联网 发布:python 加一列 编辑:程序博客网 时间:2024/06/02 06:18
总结下来主要有3种方法:
1. 用ln将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边
ln -/where/you/install/lib/*.so /usr/lib
sudo ldconfig


2.修改LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH
sudo ldconfig


3.修改/etc/ld.so.conf,然后刷新


vim /etc/ld.so.conf

add /where/you/install/lib

sudo ldconfig

不过,很多大牛并不建议通过修改LD_LIBRARY_PATH这种方式

  • LD_LIBRARY_PATH is not the answerhttp://prefetch.net/articles/linkers.badldlibrary.html
  • Why LD_LIBRARY_PATH is bad     http://xahlee.org/UnixResource_dir/_/ldpath.html
  • LD_LIBRARY_PATH - just say no    http://blogs.sun.com/rie/date/20040710

0 0
原创粉丝点击