编译工程需要Opencv3 与 ROS自带Opencv4冲突解决办法
opencv
OpenCV: 开源计算机视觉库
项目地址:https://gitcode.com/gh_mirrors/opencv31/opencv
免费下载资源
·
- 在CmakeLists中 屏蔽ROS自带的Opencv库
file(GLOB_RECURSE OLD_OPENCV "/usr/lib/x86_64-linux-gnu/libopencv*")
list(REMOVE_ITEM catkin_LIBRARIES ${OLD_OPENCV})
- 此时可能 cv_brige 也会发生冲突,因为默认的 cv_brige 也是和 Opencv4 配套使用
/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /opt/ros/noetic/lib/libcv_bridge.so, may conflict with libopencv_core.so.3.4
/usr/bin/ld: CMakeFiles/vins_node.dir/src/vslam.cpp.o: undefined reference to symbol '_ZNK2cv8FileNodecviEv'
/usr/bin/ld: /lib/x86_64-linux-gnu/libopencv_core.so.4.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [vslam/CMakeFiles/vins_node.dir/build.make:267: lib/vins/vins_node] Error 1
make[1]: *** [CMakeFiles/Makefile2:12727: CMakeFiles/vins_node.dir/all] Error 2
需要修改如下内容:
/opt/ros/noetic/share/cv_bridge/cmake$ sudo vim cv_bridgeConfig.cmake
1.头文件目录:修改为安装opencv3的路径
2.库目录:需要什么库链接什么库就够了
GitHub 加速计划 / opencv31 / opencv
77.38 K
55.71 K
下载
OpenCV: 开源计算机视觉库
最近提交(Master分支:2 个月前 )
48668119
dnn: use dispatching for Winograd optimizations 2 天前
3dace76c
flann: remove unused hdf5 header 2 天前
更多推荐
已为社区贡献3条内容
所有评论(0)