【问题标题】:CMakeLists cannot find opencv library, although i defined itCMakeLists 找不到 opencv 库,虽然我定义了它
【发布时间】:2020-06-02 06:09:24
【问题描述】:

我尝试将 ROS 与 opencv 一起使用,但是当我“catkin-make”时,它给了我这个:

  CMake Error at /opt/ros/kinetic/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.
Call Stack (most recent call first):
  fls_package/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/vered/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/vered/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:318: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

使用 cmake-gui,我定义了: 1. CMAKE_PREFIX_PATH = /home/vered/opencv/build(OpenCVConfig.cmake 所在的位置) 2. OpenCV_DIR = /usr/local/include/opencv4/opencv2(opencv.hpp在哪里)

配置,生成,然后 sudo make install,

当 catkin-make 时,我也遇到了同样的问题。 有什么想法吗?

【问题讨论】:

  • 不应该CMAKE_PREFIX_PATH包含包含OpenCVConfig.cmake文件的目录吗?
  • 你说得对,已编辑:) 仍然无法正常工作
  • 消息Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH 表示变量CMAKE_PREFIX_PATH 应该指定目录,您在配置OpenCV 时已将其传递给cmake。消息...set "OpenCV_DIR" to a directory containing one of the above files. 表示在OpenCV_DIR 变量中指定的目录应包含OpenCVConfig.cmake 或opencv-config.cmake 文件。

标签: opencv cmake ros


【解决方案1】:

似乎我尝试了网站中的所有解决方案,除了这个: ROS "catkin_make" cannot find OpenCVConfig.cmake 这对我有用...

【讨论】:

    猜你喜欢
    • 2022-01-08
    • 1970-01-01
    • 2020-02-23
    • 2018-07-13
    • 1970-01-01
    • 2019-10-17
    • 1970-01-01
    • 1970-01-01
    • 2012-03-29
    相关资源
    最近更新 更多