Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libcxcore.so.2 missing in openCV

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

like image 345
Bart Avatar asked Mar 06 '11 19:03

Bart


3 Answers

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.

like image 196
Ahmet Keskin Avatar answered Oct 13 '22 21:10

Ahmet Keskin


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
like image 8
Zifei Tong Avatar answered Oct 13 '22 21:10

Zifei Tong


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"
like image 3
Niranjan Viladkar Avatar answered Oct 13 '22 20:10

Niranjan Viladkar