Page 1 of 1

time of day error

Posted: Sun May 17, 2009 1:03 am
by F0L
Hi, I have been searching round for ages, but found nothing.

I keep getting this error;

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-ge
kko/lib\libc.a(lib_a-sysgettod.o): In function `gettimeofday':
(.text+0x20): undefined reference to `_gettimeofday_r'

Now, I have tried, devkitpro 1.4.8, 1.4.9 and 1.5.0.
I also tried libogc 1.7.0, 1.7.1 and 1.7.1a

Still I get the compile error. I was told this problem is know, but is there anyway around it?

Im running XP 32Bit.

Re: time of day error

Posted: Mon May 18, 2009 2:17 am
by WinterMute
This will be fixed with devkitPPC release 18 which should be out some time this week.

In the meantime is there anything you need from gettimeofday that isn't provided by time()?

Or just define gettimeofday in your app somewhere

Code: Select all

int gettimeofday(struct timeval *tp, struct timezone *tz) {
 
	if (tp != NULL) {
		tp->tv_sec = time(NULL);
		tp->tv_usec = 0;
	}
	if (tz != NULL) {
		tz->tz_minuteswest = 0;
		tz->tz_dsttime = 0;
 
	}
	return 0;
}