Linux openCV 中缺少 libcxcore.so.2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5212728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
libcxcore.so.2 missing in openCV
提问by Bart
I'm trying to run some precompiled code (source code is not available) on Ubuntu, which requires openCV to be installed. I installed the latest version of openCV (from the SVN) yesterday, and installed it according to the debian install guide on the openCV website (cmake -> make -> sudo make install) and everything seemed to go fine.
我正在尝试在 Ubuntu 上运行一些预编译代码(源代码不可用),这需要安装 openCV。我昨天安装了最新版本的 openCV(来自 SVN),并根据 openCV 网站上的 debian 安装指南(cmake -> make -> sudo make install)安装它,一切似乎都很顺利。
Now when I try to run the precompiled code, i'm getting the error "./stipdet: error while loading shared libraries: libcxcore.so.2: cannot open shared object file: No such file or directory" It seems that other people who are having a similar problem managed to fix it by moving libcxcore.so.2 from the opencv lib folder to somewhere else, but I don't have libcxcore.so.2 in my opencv folder at all. I do see libopencv_core.so.2.2 in there among other things. Could it be that the name of libcxcore has been changed in the latest version of openCV? Or did I not install it correctly?
现在,当我尝试运行预编译代码时,出现错误“./stipdet:加载共享库时出错:libcxcore.so.2:无法打开共享对象文件:没有这样的文件或目录”似乎其他人遇到类似问题的人设法通过将 libcxcore.so.2 从 opencv lib 文件夹移动到其他地方来修复它,但我的 opencv 文件夹中根本没有 libcxcore.so.2。我确实在其中看到了 libopencv_core.so.2.2。会不会是最新版本的openCV中libcxcore的名字发生了变化?还是我没有正确安装?
btw: running locate libcxcore in the terminal returns nothing
顺便说一句:在终端中运行 locate libcxcore 不返回任何内容
采纳答案by Ahmet Keskin
I had the same problem and I solved the problem by installing libcv, libcvaux, libhighgui and their -dev libraries from Synaptics. But the program dependent on the libcv.so.2 shared libraries but Synaptics installs libcv.so.4.0.0. So I created symbolic links for every installed library by running command:
我遇到了同样的问题,我通过从 Synaptics 安装 libcv、libcvaux、libhighgui 和它们的 -dev 库解决了这个问题。但是程序依赖于 libcv.so.2 共享库但 Synaptics 安装了 libcv.so.4.0.0。所以我通过运行命令为每个已安装的库创建了符号链接:
sudo ln -s /usr/lib/libcxcore.so.4.0.0 /usr/lib/libcxcore.so.2
and so on for every library that the program needs. Now it is working fine for me.
对于程序需要的每个库,依此类推。现在它对我来说工作正常。
回答by etarion
Yes, the library names have changed. Try OpenCV 2.1 or 2.0 (it changed either for 2.2 or 2.1 i think). If your precompiled code is for ubuntu, why didn't you install the ubuntu opencv package?
是的,库名称已更改。尝试 OpenCV 2.1 或 2.0(我认为它更改为 2.2 或 2.1)。如果你的预编译代码是针对 ubuntu 的,你为什么不安装 ubuntu opencv 包?
回答by Zifei Tong
I had the same problem working on STIP and OpenCV 2.2. To solve the issue, just create symbolic links as below. It works for me.
我在处理 STIP 和 OpenCV 2.2 时遇到了同样的问题。要解决此问题,只需创建如下符号链接即可。这个对我有用。
libcvaux.so.2 -> /usr/lib/libopencv_video.so.2.2.0
libcv.so.2 -> /usr/lib/libopencv_legacy.so.2.2.0
libcxcore.so.2 -> /usr/lib/libopencv_core.so.2.2.0
libhighgui.so.2 -> /usr/lib/libopencv_highgui.so.2.2.0
libml.so.2 -> /usr/lib/libopencv_ml.so.2.2.0
回答by Mayank Rana
This error is because they change the library names after openCV 2.2, however STIP depends on previous libraries. You just need to set few symbolic links and it will work. The following link will solve your problem http://web.michaelchughes.com/how-to/install-stip-software-with-opencv-v2
这个错误是因为他们在 openCV 2.2 之后更改了库名,但是 STIP 依赖于以前的库。您只需要设置几个符号链接,它就会起作用。以下链接将解决您的问题 http://web.michaelchughes.com/how-to/install-stip-software-with-opencv-v2
回答by Niranjan Viladkar
a small addition to (correct) answer by Zifei Tong: One needs to make the symbolic links AND also needs to export LD_LIBRARY_PATH for bash, it is :
Zifei Tong 的(正确)答案的一个小补充:需要制作符号链接并且还需要为 bash 导出 LD_LIBRARY_PATH,它是:
libcvaux.so.2 -> /usr/lib/libopencv_video.so.2.2.0
libcv.so.2 -> /usr/lib/libopencv_legacy.so.2.2.0
libcxcore.so.2 -> /usr/lib/libopencv_core.so.2.2.0
libhighgui.so.2 -> /usr/lib/libopencv_highgui.so.2.2.0
libml.so.2 -> /usr/lib/libopencv_ml.so.2.2.0
export LD_LIBRARY_PATH="path to symbolic links' directory"