Linux 下运行程序找不到Lib库解决方法

1、例如

error while loading shared libraries: xxx: cannot open shared object file: No such file or directory

方法一:

1、将程序中的lib库copy到 /lib或者 /usr/local/lib目录下

2、执行ldconfig

ldconfig命令的用途, 主要是在默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下

方法二:

# vim /etc/ld.so.conf //在新的一行中加入库文件所在目录
/xx//xxxxx 

# ldconfig //更新/etc/ld.so.cache文件

本博客是个人工作中记录,遇到问题可以互相探讨,没有遇到的问题可能没有时间去特意研究,勿扰。
另外建了几个QQ技术群:
2、全栈技术群:616945527,加群口令abc123
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600

闲置域名www.nsxz.com出售(等宽等高字符四字域名)。
原文地址:https://www.cnblogs.com/zhaogaojian/p/15071767.html