对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用

1、具体报错

在编译(catkin build) svo_pro_ws时,报错:

Errors     << svo_ros:make /home/sharine/Mine/MyResearch/svo_pro_ws/logs/svo_ros/build.make.000.log
/home/sharine/Mine/MyResearch/svo_pro_ws/devel/.private/svo/lib/libsvo.so:对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用

2、问题跟因

所使用的opencv的版本不匹配

3、解决方法

查看linux 系统中 opencv版本,执行命令:

pkg-config --modversion opencv

find find_package(OpenCV REQUIRED) in the CMakeLists.txt files in each package (in rpg_common, svo_ros, svo_direct, vikit/vikit_common and svo_online_loopclosing) and replace it with

# Ubuntu 18.04 + Melodic
find_package(OpenCV 3 REQUIRED)
# Ubuntu 20.04 + Noetic
find_package(OpenCV 4 REQUIRED)

你可能感兴趣的:(ERROR,opencv,ubuntu)