ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Catkin_make failed to build opencv

asked 2022-04-01 03:23:14 -0500

Petros ADLATUS gravatar image

Hello guys,

I want to compile a package (https://github.com/mjshiggins/ros-exa...) with the catkin_make command from the catkin_ws folder, but it seems that the OpenCV header file is depreceated or not installed. I'm sure, that I install all OpenCV dependencies.

    /home/pkatsoulakos/catkin_ws/src/ros-examples-master/src/lidar/src/lidar_node.cpp:20:10: fatal error: opencv/cv.h: No such file or directory
   20 | #include <opencv/cv.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [ros-examples-master/src/lidar/CMakeFiles/lidar_node.dir/build.make:63: ros-examples-master/src/lidar/CMakeFiles/lidar_node.dir/src/lidar_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1373: ros-examples-master/src/lidar/CMakeFiles/lidar_node.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Thank you for your help.

edit retag flag offensive close merge delete

Comments

1

Have you installed apt package libopencv-dev?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-04-01 06:02:35 -0500 )edit

yes it's already installed. I copy the src folder with the 3 folders: fusion lidar radar into my personal workspace and execute catkin_make from the catkin_ws folder

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-04-01 06:16:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-01 07:29:02 -0500

Petros ADLATUS gravatar image

for everyone who is interested i found the fault. The header file is depreceated and must be changed:

opencv/cv.h -> opencv2/core.hpp
opencv/highgui -> opencv2/highgui.hpp
+ add the header: opencv2/highgui/highgui_c.h

hope this helps anybody, if he stucked with this message.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-01 03:23:14 -0500

Seen: 687 times

Last updated: Apr 01 '22