总结下来主要有3种方法:
- 用ln将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边
ln -s /where/you/install/lib/*.so /usr/lib
代码语言:javascript复制sudo ldconfig
2.修改LD_LIBRARY_PATH
代码语言:javascript复制export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH
代码语言:javascript复制sudo ldconfig
3.修改/etc/ld.so.conf,然后刷新
代码语言:javascript复制vim /etc/ld.so.conf
add /where/you/install/lib
代码语言:javascript复制sudo ldconfig
转自:https://cloud.tencent.com/developer/article/1432498