报错代码:
--- stderr: object_map
/opt/ros/melodic/include/grid_map_cv/GridMapCvConverter.hpp:73: undefined reference to `cv::Mat::Mat()'
/opt/ros/melodic/include/grid_map_cv/GridMapCvConverter.hpp:73: undefined reference to `cv::Mat::Mat()'
解决问题:
打开object_map功能包对应的Cmakelists.txts
1.crtl+f查找find_package指定你自己的opencv版本
find_package(OpenCV 3.4 REQUIRED)
2.crtl+f查找include_directories将所有的include_directories加上
${OpenCV_INCLUDE_DIRS}
include_directories(
${OpenCV_INCLUDE_DIRS}
)
3.crtl+f查找target_link_libraries将所有的target_link_libraries加上
${OpenCV_LIBS}
target_link_libraries(calibration_publisher
${OpenCV_LIBS}
)
如图所示:
一点要都加上,再次编译,编译通过。