Ubuntu新安装opencv运行运行第一个程序报错:cannot open shared object file: No such fi

来源:互联网 发布:为什么有网qq却没网络 编辑:程序博客网 时间:2024/05/22 14:42
关于linux中找不到共享库的解决方案
如 opencv中编译没错,但是运行时却出现
error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: Nosuch file or directory 解决方法:     首先共享库文件一般在/usr/local/lib下可以找到,如果找到该共享库的话,那么在   /etc/ld.so.conf.d/xxxx.conf  注意(xxxx.conf)是你自己命名的。比如我缺少opencv库 那么我就写 opencv.conf。   接下来,就在xxxx.conf文件中写path路径,比如说共享库在/usr/local/opencv/libopencv_core.so.2.4中的话,你就写 /usr/local/opencv/ 最后 sudo ldconfig - 如果有共享库输出的话,就证明成功了,

References:

About shared libraries on Linux: http://www.eyrie.org/~eagle/notes/rpath.html

About adding the OpenCV shared libraries: http://opencv.willowgarage.com/wiki/InstallGuide_Linux


本文参考http://stackoverflow.com/questions/12335848/opencv-program-compile-error-libopencv-core-so-2-4-cannot-open-shared-object-f

0 0
原创粉丝点击