我在Rpi上安装了Debian OS。在安装opencv时,我在“/ home / pi / Opencv-2.4.3 / release / lib”中创建“opencv.pc”文件。然后我输入了以下两个命令:
将以下两行添加到“bash.bashrc”文件中并保存文件: 的 PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/home/pi/Opencv-2.4.3/release/lib/pkgconfig 导出PKG_CONFIG_PATH
然后在输入这些命令后出现以下错误:
chmod + x build_all.sh
/build_all.sh
解决方案是什么?
错误是..
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
No package 'opencv' found
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
No package 'opencv' found
contours.c:1:39: fatal error: opencv2/imgproc/imgproc_c.h: No such file or directory
compilation terminated.
compiling convert_cascade.c
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
No package 'opencv' found..etc..
答案 0 :(得分:5)
要为bashrc添加正确的路径,您可以执行以下步骤
查找并编辑或添加以下行
PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/你的/路径/从/#1
导出PKG_CONFIG_PATH
保存文件:wq