无法加载/usr/local/lib (Fedora x64) 中存在的共享库 [英] cannot load shared library that exists in /usr/local/lib (Fedora x64)
问题描述
尝试运行我刚刚编译成功的程序时,出现以下错误:
When attempting to run a program I just compiled successfully, I get the following error:
./src/sensors/laser_scan_producer:加载共享库时出错:liblcm.so.1:无法打开共享对象文件:没有这样的文件或目录>
./src/sensors/laser_scan_producer: error while loading shared libraries: liblcm.so.1: cannot open shared object file: No such file or directory
ls/usr/local/lib/liblcm*
产生
/usr/local/lib/liblcm.la
/usr/local/lib/liblcm.so
/usr/local/lib/liblcm.so.1
/usr/local/lib/liblcm.so.1.2.0
为了冗余,我已经多次执行 sudo ldconfig
并将/usr/local/lib 添加到 LD_LIBRARY_PATH.
I have executed sudo ldconfig
several times and added /usr/local/lib to LD_LIBRARY_PATH for the sake of redundancy.
这用尽了我在 stackOverflow 周围搜索时看到的答案列表.
This exhausts the list of answers I've seen whilst grepping around stackOverflow.
有人发现问题吗?
推荐答案
感谢@Joachim_Pileborg:
Thank you to @Joachim_Pileborg:
ldconfig 使用文件/etc/ld.so.conf.您可以将/usr/local/lib 添加到该文件,重新运行 ldconfig 并重试
ldconfig uses the file /etc/ld.so.conf. You can add /usr/local/lib to that file, re-run ldconfig and try again
这样做解决了问题,尽管我觉得奇怪的是/usr/local/lib 在事情的自然过程中不会被检查.
Doing so fixed the problem, although I find it odd that /usr/local/lib wouldn't have been checked in the natural course of things.
这篇关于无法加载/usr/local/lib (Fedora x64) 中存在的共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!