Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sleep() in C++

Status
Not open for further replies.

brianon

Programmer
Feb 6, 2002
22
0
0
IE
Hi,

I'm using a call to sleep() in main() of a C++ program.

I've got #define unistd.h but when I compile using gnu c++ compiler I get the following error .......
" 'sleep' undeclared (first use of this function) "

Anybody got any ideas why ? I'm stumped :(

Cheers,
Brian.
 
Hi,

Instead of doing #define, use #include <unistd.h> ..

it will work .. definitly:)

regards,
Mahesh
 
sorry... the #define was a typo.
I posted again properly and it turns out it was teh version of gcc I was using(3.0.3).

Thanks,
Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top