Ask Your Question

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: 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/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/ /usr/local/lib/

Thank you

edit retag flag offensive close merge delete


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

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/' 
sudo ldconfig

Details of the steps are here

edit flag offensive delete link more

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


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


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

Seen: 13,741 times

Last updated: Jan 31 '13