Package opencv was not found in the pkg-config search path.
Ubuntu里配置opencv时,最后一步报错为:
Package opencv was not found in the pkg-config search path.
解决方法如下:
Package opencv was not found in the pkg-config search path.
解决方法如下:
cd /usr/local/lib sudo mkdir pkgconfig cd pkgconfig sudo touch opencv.pc sudo vim opencv.pc
首先建一个新的文件夹:pkgconfig
然后cd到这个文件夹下,新建opencv.pc文件;
再打开opencv.pc文件,文件内输入:
prefix=/usr/local exec_prefix=${prefix} includedir=${prefix}/include libdir=${exec_prefix}/lib Name: opencv Description: The opencv library Version:4.1.2 Cflags: -I${includedir}/opencv4 Libs: -L${libdir} -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core
lopencv_shape、lopencv_superres、lopencv_videostab
删除,目录下不存在此项
其中version是你的opencv版本。
最后:wq保存退出。
天道酬勤 循序渐进 技压群雄