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

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

Ubuntu18.04编译ORB-SLAM2遇到的问题
1.内存不足
2.‘usleep’ was not declared in this scope


问题描述:

编译./build.sh时遇到了如下问题
ORB_SLAM2/src/LocalMapping.cc:94:17: error: ‘usleep’ was not declared in this scope usleep(3000);
一开始根据报错信息在LocalMapping.cc的头文件添加

include<unistd.h>

随后依旧报错,只是报错的文件名改变,经查询,需要在以下的文件下添加头文件:
在下面的每一个文件中,加上头文件语句***#include<unistd.h>***,然后重新编译
ORB_SLAM2/src/LocalMapping.cc
ORB_SLAM2/src/LoopClosing.cc
ORB_SLAM2/src/System.cc
ORB_SLAM2/src/Tracking.cc
ORB_SLAM2/src/Viewer.cc
ORB_SLAM2/Examples/Monocular/mono_euroc.cc
ORB_SLAM2/Examples/Monocular/mono_kitti.cc
ORB_SLAM2/Examples/Monocular/mono_tum.cc
ORB_SLAM2/Examples/RGB-D/rgbd_tum.cc
ORB_SLAM2/Examples/Stereo/stereo_euroc.cc
ORB_SLAM2/Examples/Stereo/stereo_kitti.cc

在这里插入图片描述成功!

  • 6
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值