Ask Your Question
0

Missing Shared library

asked 2013-01-31 04:40:13 -0600

Piyush gravatar image

Hello all, I have just installed OpenCV 2.4.3. I ran this following sample program just to test if it is working properly. It compiles successfully but give the following error at run-time

error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory

Here is the output of the pkg-config --cflags --libs opencv

-I/usr/local/include/opencv -I/usr/local/include /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

Thank you

edit retag flag offensive close merge delete

Comments

dateay raaj ki jai ho

neerat.sharma gravatar imageneerat.sharma ( 2013-01-31 05:33:37 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-11-25 12:01:32 -0600

MHefny gravatar image

After executing:

sudo make install

you need to run the following libs accessible.

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' 
sudo ldconfig

Details of the steps are here

edit flag offensive delete link more
0

answered 2013-01-31 08:34:20 -0600

unxnut gravatar image

Your OpenCV shared objects are not installed in /usr/local/lib. You can either install them there or add the directory containing those to the environment variable LD_LIBRARY_PATH.

edit flag offensive delete link more

Comments

Thanks Now it's working. Just had to add the following line to .bashrc export LD_LIBRARY_PATH="/usr/local/lib";

Piyush gravatar imagePiyush ( 2013-01-31 09:00:14 -0600 )edit

Modify it as follows: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

unxnut gravatar imageunxnut ( 2013-01-31 13:06:01 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-01-31 04:40:13 -0600

Seen: 13,919 times

Last updated: Jan 31 '13