Skip to content

Build Failure on ROS Noetic (OpenCV 4): Incorrect include path for opencv/cv.h #40

@aaronjs99

Description

@aaronjs99

Hi,

I encountered a build failure when trying to compile SC-LIO-SAM on ROS Noetic (Ubuntu 20.04), which uses OpenCV 4.

Error:
The build fails with the error: fatal error: opencv/cv.h: No such file or directory in include/utility.h (and potentially other files).

Cause:
This seems to be because the code uses the old OpenCV 2/3 include path #include <opencv/cv.h>, which is not standard in OpenCV 4 installations provided with ROS Noetic.

Solution:
I was able to fix the build by changing the include statement in include/utility.h (line 15) from:
#include <opencv/cv.h>
to:
#include <opencv2/opencv.hpp>

Suggestion:
Could you please consider updating the include paths to be compatible with OpenCV 4 for ROS Noetic users?

Thanks for the great package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions