Prop_idze |
01-13-2006 11:46 AM |
Freealut compilation error
I have tried to compile freealut 1.0.0, but these errors occurred while I was doing 'make':
Code:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -D_XOPEN_SOURCE=500 -D__NO_CTYPE -Wall -ansi -pedantic -g -O2 -MT libalut_la-alutUtil.lo -MD -MP -MF .deps/libalut_la-alutUtil.Tpo -c alutUtil.c -fPIC -DP IC -o .libs/libalut_la-alutUtil.o
alutUtil.c: In function `alutSleep':
alutUtil.c:27: error: storage size of 't' isn't known
alutUtil.c:30: warning: implicit declaration of function `nanosleep'
alutUtil.c:27: warning: unused variable `t'
make[2]: *** [libalut_la-alutUtil.lo] Error 1
make[2]: Leaving directory `/sources/freealut-1.0.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/sources/freealut-1.0.0'
make: *** [all] Error 2
Here are the lines from the file where the compiler gives these errors:
Code:
struct timespec t; // 27 line
t.tv_sec = (time_t) seconds;
t.tv_nsec = ((long) microSecs) * 1000;
nanosleep (&t, NULL); // 30 line
'timespec' is a variable which is declared in time.h. This header is included in the file:
Code:
#if HAVE_NANOSLEEP && HAVE_TIME_H
#include <time.h>
#elif HAVE_USLEEP && HAVE_UNISTD_H
#include <unistd.h>
#elif HAVE_SLEEP && HAVE_WINDOWS_H
#include <windows.h>
#else
#error No way to sleep on this platform
#endif
So, I don't see where is the problem.
Any idea?
My compiler is gcc-3.4.5 and the distribution is made from scratch (LFS method)
|