you may have correctly installed Opencv and built your projects, but when you run the application or debug it, such error will take place
TO SOVLE IT
first, make sure your shared libs can be found under the directory /usr/local/lib
then you should make a declaration of the lib's directory in a configuration file, its name should be like /etc/ld.so.conf.d/xxx.conf
for example:
my opencv have installed in /usr/local/opencv
then I should create a configuration file and edit it as following
cd /etc/ld.so.conf.d/
touch opencv.conf
vim opencv.conf
/usr/local/opencv
to make sure it will work, use the command to print all the shared libs . Do you find them ?
sudo ldconfig -v | grep opencv
my output is :
libopencv_photo.so.2.4 -> libopencv_photo.so.2.4.10
libopencv_video.so.2.4 -> libopencv_video.so.2.4.10
libopencv_calib3d.so.2.4 -> libopencv_calib3d.so.2.4.10
libopencv_contrib.so.2.4 -> libopencv_contrib.so.2.4.10
libopencv_flann.so.2.4 -> libopencv_flann.so.2.4.10
libopencv_superres.so.2.4 -> libopencv_superres.so.2.4.10
libopencv_ml.so.2.4 -> libopencv_ml.so.2.4.10
libopencv_highgui.so.2.4 -> libopencv_highgui.so.2.4.10
libopencv_features2d.so.2.4 -> libopencv_features2d.so.2.4.10
libopencv_imgproc.so.2.4 -> libopencv_imgproc.so.2.4.10
libopencv_nonfree.so.2.4 -> libopencv_nonfree.so.2.4.10
libopencv_stitching.so.2.4 -> libopencv_stitching.so.2.4.10
libopencv_objdetect.so.2.4 -> libopencv_objdetect.so.2.4.10
libopencv_videostab.so.2.4 -> libopencv_videostab.so.2.4.10
libopencv_legacy.so.2.4 -> libopencv_legacy.so.2.4.10
libopencv_ocl.so.2.4 -> libopencv_ocl.so.2.4.10
libopencv_core.so.2.4 -> libopencv_core.so.2.4.10
libopencv_gpu.so.2.4 -> libopencv_gpu.so.2.4.10
Good luck ~