Skip to content

Compilation issues with Ubuntu 20.04 and ROS Noetic #7

@taihup

Description

@taihup

Hi!
There are some compilations issues related with OpenCV 4.2 (delivered with Ubuntu 20.04)
Some headers are deprecated as cv.h

file_player/src/ROSThread.h:20:10: fatal error: opencv/cv.h: No such file or directory
   20 | #include <opencv/cv.h>

The same happen with #include <opencv/highgui.h>, it does not exist anymore in OpenCV 4.2

This is easy to fix just replacing the lines with:

#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>

Then I have to rename some OpenCV constant occurrences:
CV_LOAD_IMAGE_COLOR -> cv::IMREAD_COLOR
CV_LOAD_IMAGE_ANYDEPTH -> cv::IMREAD_ANYDEPTH

Furthermore, there are issues related with PCL too:

pcl_config.h:7:4: error: #error PCL requires C++14 or above

To fix this, I just add the following lines to the CMakeLists.txt file:

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions