赞
踩
默认情况下,编译只会使用/lib和/usr/lib这两个目录下的库文件。如果你的库文件目录是/usr/local/xxx/lib
等,当运行程序需要链接动态库时,就会提示找不到相关的.so库,便会出现以下错误
error while loading shared libraries:xxx.so: cannot open shared object file: No such file or directory
# 编辑ld.so.conf文件
vim /etc/ld.so.conf
# 在文件末尾添上lib的完整地址,比如:
/usr/local/xx/lib
# 更新一下库文件
sudo ldconfig
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。