美文网首页
Package opencv was not found in

Package opencv was not found in

作者: _compass | 来源:发表于2020-09-07 15:36 被阅读0次

Ubuntu里配置opencv时,最后一步报错为:
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

其中version是你的opencv版本。
最后:wq保存退出。

相关文章

网友评论

      本文标题:Package opencv was not found in

      本文链接:https://www.haomeiwen.com/subject/hnqlektx.html