ros编译错误集合:opencv版本冲突 ‘resize‘ is not a member of ‘cv:: undefined Reference to ‘cv::..

catkin_make错误类型:

error:‘split’ is not a member of ‘cv::cuda’…
error:‘resize’ is not a member of ‘cv::cuda’…

recipe for target ‘all’ faild
Incvking “make -j6 -l6” faild

这里可以通过添加对应的cv头文件解决error,比如

#include  
#include "opencv2/cudawarping.hpp" 
#include "opencv2/cudaarithm.hpp" 

可以解决上面cv::cuda的error,但是这样不能解决这个问题,后面会提示
undefined Reference to ‘cv::…

解决方法:

这是因为找不到对应版本的OpenCV导致的,只需要在CMakeLists.txt文件中指定OpenCV的版本为你安装的较高版本的opencv版本就好

find_package(OpenCV 3.4.5 REQUIRED)

其中opencv版本查询命令

pkg-config --modversion opencv

https://blog.csdn.net/qq_38441692/article/details/107249191
https://blog.csdn.net/Spacegene/article/details/107613136
https://blog.csdn.net/u010712012/article/details/89930007

还有可能可以通过修改路径解决,但是没有尝试
https://blog.csdn.net/wang7807564/article/details/78416809?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

你可能感兴趣的:(ROS,ros,opencv版本冲突)