ORB-slam2编译时报错‘usleep’ was not declared in this scope

catkin_orb-slam2/src/ORB_SLAM2/src/LocaMapping.cc:160:28: error: ‘usleep’ was not declared in this scope
                 usleep(5000);
catkin_orb-slam2/src/ORB_SLAM2/src/Tracking.cc:160:28: error: ‘usleep’ was not declared in this scope
                 usleep(5000);
                 
或者

catkin_orb-slam2/src/ORB_SLAM2/Examples/RGB-D/rgbd_tum.cc: In function ‘int main(int, char**):

我们根据路径catkin_orb-slam2/src/ORB_SLAM2/src找到LocaMapping.cc然后在头文件里面添加一句 #include
然后找到catkin_orb-slam2/src/ORB_SLAM2/src/Tracking.cc也添加 #include

以此类推,所有这样的问题都这样解决。

你可能感兴趣的:(c++,linux)