OpenCV:“libopencv_core.so.2.3:无法打开共享对象文件:没有这样的文件或目录” [英] OpenCV: "libopencv_core.so.2.3: cannot open shared object file: No such file or directory"

查看:2640
本文介绍了OpenCV:“libopencv_core.so.2.3:无法打开共享对象文件:没有这样的文件或目录”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的Debian计算机上安装了OpenCV,我遇到了问题。我按照Wiki上的安装指南。试图编译例子给出了似乎是一个成功的编译,但试图运行它们最终抛出一个错误:

I've just installed OpenCV on my Debian machine, and I'm having issues with it. I followed the install guide on the Wiki. Trying to compile the examples gives what appears to be a successful compile, however trying to run them ends up throwing an error:

fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$ g++ -Wall em.cpp
-lopencv_core -lopencv_imgproc -lopencv_calib3d -lopencv_video
-lopencv_features2d -lopencv_ml -lopencv_highgui -lopencv_objdetect
-lopencv_contrib -lopencv_legacy
fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$ ./a.out
./a.out: error while loading shared libraries: libopencv_core.so.2.3:
cannot open shared object file: No such file or directory
fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$ pkg-config opencv
--libs-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui
-lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d
-lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$

但是,即使这样做不起作用:

But even doing this doesn't work:

fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$ g++ -Wall em.cpp
`pkg-config opencv --cflags --libs`
fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$ ./a.out
./a.out: error while loading shared libraries: libopencv_core.so.2.3:
cannot open shared object file: No such file or directory
fagg@hubble:~/src/OpenCV-2.3.1/samples/cpp$

我认为链接有问题,但我不太确定发生了什么。这是一个完全新安装的OpenCV - 我从来没有在这台机器上。是否有任何想法?

I think there's an issue with the linking, but I'm not quite sure what's going on. This is a completely fresh install of OpenCV - I've never had it on this machine before. Does anyone have any ideas?

推荐答案

Ran

sudo ldconfig

建议者anon.coward

Suggested by anon.coward

这篇关于OpenCV:“libopencv_core.so.2.3:无法打开共享对象文件:没有这样的文件或目录”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆