error while loading shared libraries: libcxcore.so.2: cannot open shared object file: No such file or directory
This means that the program is not able to locate the shared libraries it needs to execute. To sort this out you to have set the LD_LIBRARY_PATH environment variable to the path of your opencv lib directory. This directory should be located in your opencv installation directory(if you installed opencv using the tar rather than using your linux distribution repositories). You can do this by the following command (assuming you have installed opencv in your user directory in a folder named "opencv" :
export LD_LIBRARY_PATH=/home/{username}
Thanks you so much !!
ReplyDeleteThanks
ReplyDeleteI've installed opencv using repositories at /usr/local/include/opencv.
ReplyDeleteI get the same error as you've specified. I dont find any lib folder in opencv.
But i fonund that shared file at:
/usr/local/lib
so what should i do?
please help.
{Specifically in reply to pratik069}:
ReplyDeleteWell it's not the best solution.
When you build opencv by yourself, after issuing the 'make install' command, you'll have the libraries in /usr/local/lib and every thing is supposed to be fine by definition, BUT usually is not and you encounter the error mentioned here.
To solve this:
1- add the path '/usr/local/lib' to the file '/etc/ld.so.conf' (it should be there already)
2- sudo ldconfig
And that's it!
Great! Thank you.
ReplyDeleteThank you!
ReplyDeleteyou saved my life.
ReplyDeleteYou're my hero. Saved me from a long night of googeling
ReplyDeleteBrilliant! This shows up top when Googling the error, and no doubt saved me a lot of head scratching. Thanks so much!
ReplyDeletedo I have to run this command every time ? It works first time but when I close the terminal and open a new one gives the same error
ReplyDeletethanks dude.. it worked
ReplyDeleteThank you very much for this information.. I got very perfect soluton for face detection
ReplyDeleteThankYou very much.
ReplyDeleteYou have solved my problem..