Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: usleep is not declared in this scope #337

Open
wangzheqie opened this issue Jun 6, 2017 · 21 comments
Open

error: usleep is not declared in this scope #337

wangzheqie opened this issue Jun 6, 2017 · 21 comments

Comments

@wangzheqie
Copy link

find that file,and add the following codes to it:

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

@Jackzhemliu
Copy link

This is helpful. Thanks.

@kuonangzhe
Copy link

This just solved my problem. Thanks a lot! @wangzheqie

@jtbon20
Copy link

jtbon20 commented Aug 7, 2017

@wangzheqie Why did it work before, but now trying to reinstall I need to add it to nearly all the files?

@wangzheqie
Copy link
Author

so to me, I add it to all files needed without second thinking. And they all work.

@xuhangxx
Copy link

Thanks

@gerardsimons
Copy link

gerardsimons commented Sep 22, 2017

Thanks a lot. Why is this not already in the repo though?

@paulushcgcj
Copy link

Why do I need to add this?

I mean I can compile my code on Linux (CentOS 6) perfectly, but why do I need to add this includes when I'm using cygwin, ?

@riccitensor
Copy link

Works, but I had to add it to a bunch of files.

@kauevestena
Copy link

Was necessary to add in 11 files!
But thank you, worked
How does the developers solve this issue?

@Aceralon
Copy link

Aceralon commented Mar 17, 2018

An easier way is to add #include <unistd.h> in System.h.

@CharithEkanayake
Copy link

@Aceralon Thanks your method just sorted issue really quickly

@CharithEkanayake
Copy link

@Aceralon
Were you able to run this on a camera feed?

@ujur007
Copy link

ujur007 commented Jun 30, 2018

@wangzheqie thanks it solved my error after adding this headers in several files...
But why did I need to do this. ? What is the reason.?

@changshen
Copy link

changshen commented Jul 18, 2018

I added this for my cygwin project in windows 10 for Code::Blocks
#ifdef _CYGWIN_
#include <sys/unistd.h>
#endif // CYGWIN

and the include path of cygwin c:/cygwin/usr/include should be in search path of compiler. Where
c:/cygwin is the install root of cygwin. And in settings of compilerof cygwin, add _CYGWIN_ in user defined files "#define". You can do this in project level or in global level.

@trehansiddharth
Copy link

I have replicated that ORB_SLAM2 won't compile on several systems without adding #include <unistd.h> to System.h, as @Aceralon suggested, even after commit #577. Can we incorporate this into the master branch? It seems like it is a simple change?

B10215037 added a commit to B10215037/ORB_SLAM2 that referenced this issue Dec 30, 2018
raulmur#337 (comment)

Changes to be committed:
	new file:   .gitignore
	modified:   include/System.h
@Alex23013
Copy link

I had to add it to a bunch of files. But it works . thanks @wangzheqie

rFalque added a commit to rFalque/ORB_SLAM2 that referenced this issue Nov 16, 2019
@K296
Copy link

K296 commented May 25, 2020

I have replicated that ORB_SLAM2 won't compile on several systems without adding #include <unistd.h> to System.h, as @Aceralon suggested, even after commit #577. Can we incorporate this into the master branch? It seems like it is a simple change?

Why is this suggestion still not incorporated?

@Aceralon
Copy link

@Aceralon
Were you able to run this on a camera feed?

Yes

@stolpa4
Copy link

stolpa4 commented May 25, 2020

I have replicated that ORB_SLAM2 won't compile on several systems without adding #include <unistd.h> to System.h, as @Aceralon suggested, even after commit #577. Can we incorporate this into the master branch? It seems like it is a simple change?

Why is this suggestion still not incorporated?

Because the repo is dead. Author is lost somewhere

jskang94 added a commit to jskang94/ORB_SLAM2 that referenced this issue Jun 8, 2020
@Chatoyant19
Copy link

An easier way is to add #include <unistd.h> in System.h.

it works well! Thank u

@balisujohn
Copy link

An easier way is to add #include <unistd.h> in System.h.

This worked for me; thanks for your help!

balisujohn added a commit to balisujohn/ORB_SLAM2 that referenced this issue Mar 21, 2021
…ng/orb_slam_2_ros-1@1e6a52a, and additionally added yaml for basic SLAM test on miniworld images
Dkaka added a commit to Dkaka/ORB_SLAM2 that referenced this issue Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests