您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页[Linux]error while loading share

[Linux]error while loading share

来源:化拓教育网

在linux下运行程序时,发现了error while loading shared libraries这种错误

  • 错误:
error while loading shared libraries: libpng16.so.16

出现这类错误表示,系统不知道xxx.so放在哪个目录下,这时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。

目前解决方法是:
    1. 用find命令找到so所在lib目录
    1. 加入 ldconfig
cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
echo "/home/cyl/dir/lib" >> /etc/ld.so.conf" >> /etc/ld.so.conf
ldconfig ### 更新配置  然后就完成啦!

一般而言,有很多的so会存放在/usr/local/lib这个目录底下,去这个目录底下找,果然发现自己所需要的.so文件。

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

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务