error: ‘usleep’ was not declared in this scope usleep(mT*1000); ^~~~~~ /home/miao/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/AR/ViewerAR.cc:233:9: note: suggested alternative: ‘fseek’ usleep(mT*1000); ^~~~~~ fseek
该类错误在对应的文加加入
#include <unistd.h>
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: 无法添加符号: DSO missing from command line collect2: error: ld returned 1 exit status /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: 无法添加符号: DSO missing from command line CMakeFiles/RGBD.dir/build.make:227: recipe for target '../RGBD' failed make[2]: *** [../RGBD] Error 1 collect2: error: ld returned 1 exit status CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2 make[1]: *** 正在等待未完成的任务.... CMakeFiles/Stereo.dir/build.make:227: 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 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
解决
miao@openlib:~/catkin_ws/src/ORB_SLAM2$ locate boost_system /home/miao/vrep/libboost_system.so /home/miao/vrep/libboost_system.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_system.so /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 miao@openlib:~/catkin_ws/src/ORB_SLAM2$ cp /usr/lib/x86_64-linux-gnu/libboost_system.so /home/miao/catkin_ws/src/ORB_SLAM2/lib miao@openlib:~/catkin_ws/src/ORB_SLAM2$ cp /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 /home/miao/catkin_ws/src/ORB_SLAM2/lib/ miao@openlib:~/catkin_ws/src/ORB_SLAM2$ locate boost_filesystem /home/miao/vrep/libboost_filesystem.so /home/miao/vrep/libboost_filesystem.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_filesystem.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.so /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 miao@openlib:~/catkin_ws/src/ORB_SLAM2$ cp /usr/lib/x86_64-linux-gnu/libboost_filesystem.so /home/miao/catkin_ws/src/ORB_SLAM2/lib/ miao@openlib:~/catkin_ws/src/ORB_SLAM2$ cp /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 /home/miao/catkin_ws/src/ORB_SLAM2/lib/
在
catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2$目录下的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 -lboost_system )