linux 缺少动态连接库.so(cannot open shared object file: No such file or directory)解决办法
·
linux 缺少动态连接库.so(cannot open shared object file: No such file or directory)解决办法
对于自行编译的库,如opus,opencv等,其自带的可执行程序在使用时有时候会报cannot open shared object file: No such file or directory的错误,事实上,相关的依赖库已经安装或编译了,这是由于大部分的自编译库都是默认存放在/usr/local/lib中的,而Linux系统通常只会去/usr/lib中寻找库文件,这就导致无法加载库文件导致报错。
解决方法(三选一)
-
使用ln命令对
*.so文件创建链接,放到/usr/lib中ln -s /your install path/xxx.so /usr/lib sudo ldconfig -
修改宏变量
LD_LIBRARY_PATH在修改~/.bashrc文件,在其中增加一条 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your install path -
修改/etc/ld.so.conf,然后刷新
vim /etc/ld.so.conf add /where/you/install/lib sudo ldconfig
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)