I have installed opencv it compiled 100%, i have run a command: pkg-config --cflags --libs opencv It's output is:-I/usr/include/opencv -I/usr/include/opencv4 -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -lopencv_core -lopencv_ml -lopencv_features2d -lopencv_objdetect -lopencv_flann -lopencv_video -lopencv_highgui
But when i try to compile a c++ code it gives cannot find error, I don't know what to do. Thanks..
~/cpp_test$
g++ main.cpp -o output `pkg-config --cflags --libs opencv`
/usr/bin/x86_64-linux-gnu-ld: cannot find -lopencv_contrib
/usr/bin/x86_64-linux-gnu-ld: cannot find -lopencv_legacy
collect2: error: ld returned 1 exit status
opencv_contrib.so
andopencv_legacy.so
are in the/usr/lib
folder, if not, create symlinks to the actual library files in/usr/lib
– Soulimane Mammar