libcxcore.so.2 missing in openCV

2020-05-28 01:30发布

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.

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?

btw: running locate libcxcore in the terminal returns nothing

5条回答
▲ chillily
2楼-- · 2020-05-28 01:51

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?

查看更多
来,给爷笑一个
3楼-- · 2020-05-28 01:59

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.

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
查看更多
Deceive 欺骗
4楼-- · 2020-05-28 02:01

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:

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.

查看更多
来,给爷笑一个
5楼-- · 2020-05-28 02:07

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 :

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"
查看更多
疯言疯语
6楼-- · 2020-05-28 02:08

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

查看更多
登录 后发表回答