0

我目前遇到的问题是find_package(opencv)给我错误消息:

 -- Could not find the required component 'OpenCV'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "OpenCV" with any
  of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.

所以..是的,一个解决方案会添加prefix_path,但是我如何在find_package()不明确说明它必须寻找的路径的情况下使其工作..为什么它不能首先找到它,这样做的问题是CMakelist 在一群人之间共享,尽管我是唯一一个遇到此问题的人,但 .cmake 文件位于同一位置..

我在 ubuntu 机器上运行它。

OpenCV v2.4.8

.cmake 文件位于

/usr/local/share/OpenCV/OpenCVConfig.cmake /usr/share/OpenCV/OpenCVConfig.cmake

opencv 安装为sudo apt-get install libopencv-dev

4

0 回答 0