ORB_SLAM2 安装编译报错:“undefined reference to symbol '_ZN5boost6system15system_categoryEv'”
错误信息
ubuntu@Turbot-SLAM:~/catkin_ws/src/ORB_SLAM2$ ./build_ros.sh
Building ROS nodes
mkdir: cannot create directory ‘build’: File exists
[rosbuild] Building package ORB_SLAM2
[rosbuild] using multiarch 'x86_64-linux-gnu' for finding Boost
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/sensor_ws/devel;/home/ubuntu/catkin_ws/devel;/home/ubuntu/cartographer_ws/install_isolated;/home/ubuntu/turtlebot/devel;/home/ubuntu/kobuki/devel;/home/ubuntu/rocon/devel;/opt/ros/kinetic
-- This workspace overlays: /home/ubuntu/sensor_ws/devel;/home/ubuntu/catkin_ws/devel;/home/ubuntu/cartographer_ws/install_isolated;/home/ubuntu/turtlebot/devel;/home/ubuntu/kobuki/devel;/home/ubuntu/rocon/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Skip enable_testing() for dry packages
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.18
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
[rosbuild] Including /opt/ros/kinetic/share/roslisp/rosbuild/roslisp.cmake
[rosbuild] Including /opt/ros/kinetic/share/roscpp/rosbuild/roscpp.cmake
[rosbuild] Including /opt/ros/kinetic/share/rospy/rosbuild/rospy.cmake
Build type: Release
-- Using flag -std=c++11.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build
[ 0%] Built target rospack_genmsg_libexe
[ 0%] Built target rosbuild_precompile
[ 11%] Linking CXX executable ../Mono
[ 33%] Linking CXX executable ../RGBD
[ 33%] Linking CXX executable ../Stereo
[ 44%] Linking CXX executable ../MonoAR
/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:220: 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....
/usr/bin/ld: CMakeFiles/Stereo.dir/src/ros_stereo.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/Stereo.dir/build.make:220: recipe for target '../Stereo' failed
make[2]: *** [../Stereo] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]: *** [CMakeFiles/Stereo.dir/all] Error 2
[ 55%] Built target Mono
[ 77%] Built target MonoAR
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
1 个回复
lalala
赞同来自:
修改Examples/ROS/ORB_SLAM2/文件夹下的CMakeLists.txt文件
将
修改为
参考资料
https://blog.csdn.net/u014709760/article/details/85253525