Game Development Community

1.3beta and SDK 4 compile error - usleep was not declared in this scope

by Johnny Vo · in iTorque 2D · 06/22/2010 (11:19 pm) · 5 replies

I get one error when trying to build a 1.3beta project with SDK4 - usleep was not declared in this scope.

I'm not proficient with objective C. Anyone know how I can fix this?

usleep is from this method.

/// Asks the operating system to put the process to sleep for at least ms milliseconds
void Platform::sleep(U32 ms)
{
// note: this will overflow if you want to sleep for more than 49 days. just so ye know.
// -Mat Need to fix this
usleep( ms * 1000 );
}

#1
06/22/2010 (11:45 pm)
Solved.

Included #include <unistd.h> in iphonetime.mm.
#2
07/09/2010 (11:38 am)
Thanks Johnny - just hit the same problem - decided to move my stuff over now the RC is out.
#3
07/09/2010 (3:15 pm)
No problem, Scott. Are you moving IWT or a new game?
#5
07/09/2010 (6:15 pm)
OKay, got it all working and can see no difference in smoothness or performance on 3G or 3GS :( 3G if anything seems to be worse.