ORB-SLAM2部署,编译错误问题解决方法ros_rgbd.cc.o: undefined reference to symbol

  • ORB-SLAM2部署
  • https://github.com/raulmur/ORB_SLAM2

https://blog.csdn.net/u014709760/article/details/85253525

可参考上述连接进行。遇到些问题。

    1. 问题一解决CMake Error

$gedit ~/.bashrc

在文件最后添加一行,下行路径根据自己电脑的实际路径填写,例如我的是:

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/a/slamws/src/ORB_SLAM2/Examples/ROS

 

ORB-SLAM2部署,编译错误问题解决方法ros_rgbd.cc.o: undefined reference to symbol_第1张图片

    1. 问题二解决libg2o.so

。。。。。

[  0%] Built target rosbuild_precompile

make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../RGBD'.  Stop.

CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed

make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

先执行./build.sh

再执行./build_ros.sh,OK.

    1. 问题三解决undefined reference to symbol

[ 11%] Linking CXX executable ../RGBD

/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:216: 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

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

方法:

$gedit ./Examples/ROS/ORB_SLAM2/CMakeLists.txt

添加一行-lboost_system

ORB-SLAM2部署,编译错误问题解决方法ros_rgbd.cc.o: undefined reference to symbol_第2张图片

 

你可能感兴趣的:(无人驾驶)