欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ORBSLAM2安装问题总结

程序员文章站 2024-03-25 19:26:10
...

在编译ubuntu16.04ros包的时候出现以下问题

问题1:libboost_system.so 与libboost_filesystem.so找不到链接目录

详细错误:
/usr/bin/ld: CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv’
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/RGBD.dir/build.make:223: recipe for target ‘…/RGBD’ failed
make[2]: *** […/RGBD] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/RGBD.dir/all’ failed
make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…

错误原因:
libboost_system.so 与libboost_filesystem.so找不到链接目录
解决方法:

  1. 查找链接
$ locate libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0

  1. 将libboost_system.so复制到ORB_SLAM2/lib下
  2. 将ORBSLAM2/Examples/ROS/ORBSLAM2下的Cmakelists.txt中加入库目录
set(LIBS
${OpenCV_LIBS}
${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/libboost_system.so