OpenCV多版本冲突,出现“对‘cv Mat Mat()’未定义的引用‘cv imread(cv String const&, int)’未定义的引用”等问题

1.版本冲突,修改功能包的CMakelists.txt文件就可以了

先查询自己所用的OpenCV版本号

opencv_version

 或者是

pkg-config --modversion opencv

/usr/bin/ld: warning: libopencv_imgproc.so.3.4, needed by /usr/local/lib/libopencv_highgui.so.3.4.15, may conflict with libopencv_imgproc.so.3.2

 我这里是3.4.15,根据自己情况来定

打开对应功能包的CMakelists.txt:

find_package(OpenCV REQUIRED) //将这段代码
find_package(OpenCV 3.4.15 REQUIRED) //替换为这段代码

 然后catkin_make

2.出现报错:

/usr/bin/ld: warning: libopencv_imgproc.so.3.4, needed by /usr/local/lib/libopencv_highgui.so.3.4.15, may conflict with libopencv_imgproc.so.3.2

直接 :

rosdep update

编译完成

你可能感兴趣的:(ubuntu,ROS,opencv,计算机视觉,人工智能,ubuntu,linux)