본문 바로가기
Libraries & Packages/ROS

cmake error "Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir, which is not found." Solution

by yongee97 2023. 5. 26.

* Error message

CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
  Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir,
  which is not found.  It does neither exist as an absolute directory nor in
  '${{prefix}}//usr/include/opencv'.  Check the issue tracker
  'https://github.com/ros-perception/vision_opencv/issues' and consider
  creating a ticket if the problem has not been reported yet.

 

 

* Solution

Path should be change manually

 

cd /opt/ros/melodic/share/cv_bridge/cmake
sudo gedit cv_bridgeConfig.cmake

inside the editor, change this line

# set(_include_dirs "include;/usr/include;/usr/include/opencv")
set(_include_dirs "include;/usr/include;/usr/include/opencv4")

 

 

 

* Reference

https://github.com/ros-perception/vision_opencv/issues/345

 

Project 'cv_bridge' can not find opencv · Issue #345 · ros-perception/vision_opencv

Hi, I am compiling https://github.com/thien94/vision_to_mavros. I have installed mavros and vision_opencv from apt command. However, Project 'cv_bridge' can not find opencv. CMake Error at /opt/ros...

github.com