Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile: /opt/ros/melodic/include/image_geometry/pinhole_camera_model.h:5:10: fatal error: opencv2/core/core.hpp: No such file or directory #56

Open
EdMlt opened this issue Sep 18, 2021 · 1 comment

Comments

@EdMlt
Copy link

EdMlt commented Sep 18, 2021

Hi, I wanted to use the depth_image_to_laserscan packagewith my intel realsense. Therefore I pulled this repo in my catkin_ws/src folder and when I try to catkin_make, it fails when coming to this package, here is the stack:
[ 9%] Built target depthimage_to_laserscan_gencfg [ 18%] Building CXX object depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/src/DepthImageToLaserScan.cpp.o [ 36%] Built target rviz_click_to_2d In file included from /home/palojetson/Documents/palobot/catkin_ws/src/depthimage_to_laserscan/include/depthimage_to_laserscan/DepthImageToLaserScan.h:40:0, from /home/palojetson/Documents/palobot/catkin_ws/src/depthimage_to_laserscan/src/DepthImageToLaserScan.cpp:34: /opt/ros/melodic/include/image_geometry/pinhole_camera_model.h:5:10: fatal error: opencv2/core/core.hpp: No such file or directory #include <opencv2/core/core.hpp> ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/build.make:62: recipe for target 'depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/src/DepthImageToLaserScan.cpp.o' failed make[2]: *** [depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/src/DepthImageToLaserScan.cpp.o] Error 1 CMakeFiles/Makefile2:1824: recipe for target 'depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/all' failed make[1]: *** [depthimage_to_laserscan/CMakeFiles/DepthImageToLaserScan.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
Tried many things, it seems my opencv2 is installed, I don't know from where is the issue

Thank you for the help! :D

@eddiem3
Copy link

eddiem3 commented Dec 29, 2021

I had the exact same error and then a series of errors afterward. I resolved this by editing the CMakelists.txt.
I uncommented line 4:

find_package(OpenCV REQUIRED)

and I also added

include_directories(${OpenCV_INCLUDE_DIRS})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants