Dear all
I am trying to a compile a GLClock app, however I have some difficulty related to ftime()
What should I use ?
The error I am getting is:
$ ppc-amigaos-g++ CGClock.cpp -o CGClock -lGL -lGLU -lGLUT
/tmp/ccTAWsKT.o: In function `_Z14TimerFunction4i':
CGClock.cpp:(.text+0x30f0): undefined reference to `ftime'
Code snippet is:
void TimerFunction4(int value){
struct timeb tb;
time_t tim=time(0);
struct tm* t;
t=localtime(&tim);
ftime(&tb);
//angleSec = (float)(t->tm_sec+ (float)tb.millitm/1000.0f)/30.0f * M_PI;
angleSec = (float)(t->tm_sec)/30.0f * M_PI;
angleMin = (float)(t->tm_min)/30.0f * M_PI + angleSec/60.0f;
angleHour = (float)(t->tm_hour > 12 ? t->tm_hour-12 : t->tm_hour)/6.0f * M_PI+
angleMin/12.0f;
glutPostRedisplay();
glutTimerFunc(1000,TimerFunction4, 1);
void TimerFunction4(int value){
struct timeb tb;
time_t tim=time(0);
struct tm* t;
t=localtime(&tim);
ftime(&tb);
//angleSec = (float)(t->tm_sec+ (float)tb.millitm/1000.0f)/30.0f * M_PI;
angleSec = (float)(t->tm_sec)/30.0f * M_PI;
angleMin = (float)(t->tm_min)/30.0f * M_PI + angleSec/60.0f;
angleHour = (float)(t->tm_hour > 12 ? t->tm_hour-12 : t->tm_hour)/6.0f * M_PI+
angleMin/12.0f;
glutPostRedisplay();
glutTimerFunc(1000,TimerFunction4, 1);
}
The ftime() function is not supported. You can use clock_gettime() (requires newlib.library >= 53.44) or gettimeofday() instead as they provide equivalent functionality.
You can use this replacement function