当前位置:   article > 正文

autoware解决报错:get_Depth.cpp:(.text+0x9c8): undefined reference to `cv::Mat::Mat()‘_autoware编译 data_preprocessor报错

autoware编译 data_preprocessor报错

遇到报错:

--- stderr: data_preprocessor
CMakeFiles/get_Depth.dir/nodes/get_Depth/get_Depth.cpp.o: In function `SaveDepth::create_depth()':
get_Depth.cpp:(.text+0x9c8): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0xa8b): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0xb30): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0xb8c): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0xbff): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0xd23): undefined reference to `cv::Mat::Mat(int, int, int)'
CMakeFiles/get_Depth.dir/nodes/get_Depth/get_Depth.cpp.o: In function `SaveDepth::read_CalibFile()':
get_Depth.cpp:(.text+0x248e): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0x24c2): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text+0x24f6): undefined reference to `cv::Mat::Mat()'
CMakeFiles/get_Depth.dir/nodes/get_Depth/get_Depth.cpp.o: In function `main':
get_Depth.cpp:(.text.startup+0xacf): undefined reference to `cv::Mat::Mat()'
get_Depth.cpp:(.text.startup+0xb00): undefined reference to `cv::Mat::Mat()'
CMakeFiles/get_Depth.dir/nodes/get_Depth/get_Depth.cpp.o:get_Depth.cpp:(.text.startup+0xb0d): more undefined references to `cv::Mat::Mat()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [devel/lib/data_preprocessor/get_Depth] Error 1
make[1]: *** [CMakeFiles/get_Depth.dir/all] Error 2
make: *** [all] Error 2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

在这里插入图片描述

解决方法:

找到data_preprocessor功能包的的Cmakelist.txt文件,进行如下修改:

//指定OpenCV,此处为你安装的版本
find_package(OpenCV 3.4 REQUIRED)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
)

target_link_libraries(get_Depth ${catkin_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(get_PCD ${catkin_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(get_Image ${catkin_LIBRARIES} ${OpenCV_LIBS})
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

如图所示:
在这里插入图片描述问题解决

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/300495
推荐阅读
相关标签
  

闽ICP备14008679号