pkg-config出错

时间:2013-07-24 10:17:32

标签: opencv debian pi

我在Rpi上安装了Debian OS。在安装opencv时,我在“/ home / pi / Opencv-2.4.3 / release / lib”中创建“opencv.pc”文件。然后我输入了以下两个命令:

  1. sudo gedit /etc/bash.bashrc
  2. 将以下两行添加到“bash.bashrc”文件中并保存文件: 的 PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/home/pi/Opencv-2.4.3/release/lib/pkgconfig 导出PKG_CONFIG_PATH

    然后在输入这些命令后出现以下错误:

    1. chmod + x build_all.sh

    2. /build_all.sh

    3. 解决方案是什么?

      错误是..

      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..
      

1 个答案:

答案 0 :(得分:5)

要为bashrc添加正确的路径,您可以执行以下步骤

  1. sudo find / -name“opencv.pc”-type f
  2. 注意1.(无文件名)
  3. 的目录输出
  4. 打开/etc/bash.bashrc sudo vi /etc/bash/bash.bashrc
  5. 查找并编辑或添加以下行

    PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/你的/路径/从/#1

    导出PKG_CONFIG_PATH

  6. 保存文件:wq

  7. 注销并再次登录以激活更改