/usr/bin/ld: CMakeFiles/VIO.dir/src/ros_vio.cc.o: undefined reference to symbol '_ZN2cv6String10deal

/usr/bin/ld: CMakeFiles/VIO.dir/src/ros_vio.cc.o: undefined reference to symbol ‘_ZN2cv6String10deallocateEv’
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3.1: error adding symbols: DSO missing from command line

orb_slam2 编译时./build时
关于libopencv_core3.so.3.3.1
没错在解决了libboost_system这个bug时,又出来一个新bug.关键是两者还那么像,相当一段时间
没有发现是新问题,还是按照libboost找解决方案。哭辽
/usr/bin/ld: CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o: undefined reference to symbol ‘_ZN2cv6String10deallocateEv’
/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3.1: error adding symbols: DSO missing from command line

解决方法和libboost的方法三差不多,都是移动文件至src/orb_slam2/lib中
我是将/opt/ros/kinetic/lib/x86_64-linux-gnu/文件夹下的libopencv_core3.so.3.3.1(没错就是它),移动到src/orb_slam2/lib中;
然后将example/ros/orb_slam2中的cmakelists.txt文件中set()添加
${PROJECT_SOURCE_DIR}/…/…/…/lib/libopencv_core3.so.3.3.1

set(LIBS
KaTeX parse error: Expected ‘EOF’, got ‘#’ at position 15: {OpenCV_LIBS} #̲{OpenCV_LIBRARIES}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/…/…/…/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/…/…/…/Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/…/…/…/lib/libORB_SLAM2.so
${PROJECT_SOURCE_DIR}/…/…/…/lib/libopencv_core3.so.3.3.1
)

你可能感兴趣的:(orb-slam2)