|
From: Charles S. <cws...@tr...> - 2007-05-18 16:17:44
|
I'm a newbie to MinGW, looking to compile a free-standing version of my
FOSS Linux C language program for Windows XP users.
My program builds and runs correctly so long as I omit a sleep()
function (which is critical to other parts of the program).
Here's a test program:
---------------
/* sleeptest.c */
#include <unistd.h>
int main ( void )
{
sleep(5);
return 0;
}
---------------
Running:
gcc -Wall sleeptest.c -o sleeptest
yields the error message:
sleeptest.c: In function `main':
sleeptest.c:5: warning: implicit declaration of function `sleep'
C:\DOCUME~1\winuser\LOCALS~1\Temp/cceccaaa.o<.text+0x32>:sleeptest.c undefined reference to `sleep'
collect2: ld returned 1 exit status
I have downloaded and un-TAR'd the following MinGW binary packages into
directory c:\mingw
gcc-core-3.4.2-20040916-1.tar.gz
mingw-runtime-3.9.tar.gz
mingw-utils-0.3.tar.gz
w32api-3.6.tar.gz
binutils-2.15.91-20040904-1.tar.gz
What else do I need to install to get the sleep() function?
Thanks for your help.
Regards,
Charles Sullivan
|