unable to find opencv through pkg-config --cflags opencv
i followed this comprehensive guide to install opencv4.1.0 in my ubuntu18.04.
https://cv-tricks.com/installation/op...
i made changes in my opencv4.pc file, added opencv2 as mentioned in install guide (includedir_old=${prefix}/include/opencv4/opencv2) and added this file to /usr/local/lib/pkg-config. i also added this path PKG_CONFIG_PATH=/usr/local/lib/pkg-config to bashrc file. i counter checked by echo command it shows the path rightly
but when i do pkg-config for opencv it still says Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable Package 'opencv', required by 'world', not found
what should i do? because of this i am unable to cmake c++ file
that's step 11 in your tut.
also note, that the opencv devs prefer cmake to pkg-config
last, you should still be able to run your own cmdline (and ditch all "helpful" tools), like:
it's also
pkg-config opencv4
, notopencv
Thankyou @berak. opencv4 it is. one mistake i was doing: in cmake find_package(opencv) is wrong we should write find_package(OpenCV).