linking issue with opencv and ros indigo while trying to install vision_opencv

不想你离开。 提交于 2019-12-25 12:45:36

问题


Hi my question is of two folds. First, I am confused as why there are opencv3 and OpenCV-3.1.0-dev packages is in /opt/ros/indigo/share as i have read that opencv 2.4.8 is the default version of ROS indigo.

Also, I have opencv 2.4.13 version installed on ubuntu 14.04 with ROS Indigo, I want to use opencv for vision part for my project and for that i tried to install vision_opencv package from source. However when I try to build the package using catkin_make following error occurs

similar question is asked here ROS, opencv3 and CMake - unable to remove the library

-- ==> add_subdirectory(vision_opencv/image_geometry)

CMake Error at /opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake:183 (message): The imported target "opencv_xobjdetect" references the file

 "/opt/ros/indigo/lib/libopencv_xobjdetect3.so.3.1.0"

but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and contained

    "/opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVModules.cmake"

    but not all the files it references.

Call Stack (most recent call first): /opt/ros/indigo/share/OpenCV-3.1.0-dev/OpenCVConfig.cmake:86 (include) vision_opencv/image_geometry/CMakeLists.txt:5 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/hemang/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/hemang/catkin_ws/build/CMakeFiles/CMakeError.log".


What I dont understand is why is it trying to link with Opencv3 when system does not have opencv3 installed or ROS indigo comes with opencv3 now ??


回答1:


so I figured it out so in the CMakeLists.txt files of both cv_bridge and image_geometry, find package(OpenCV REQUIRED) should be find package (OpenCV 2.4.13 REQUIRED) . This is in my case as I have OpenCV 2.4.13 installed, one can replace it with any version one is using.



来源:https://stackoverflow.com/questions/43074272/linking-issue-with-opencv-and-ros-indigo-while-trying-to-install-vision-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!