time of day error

support for the powerpc toolchain
Post Reply
F0L
Posts: 1
Joined: Sun May 17, 2009 12:56 am

time of day error

Post by F0L » Sun May 17, 2009 1:03 am

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.

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: time of day error

Post by WinterMute » Mon May 18, 2009 2:17 am

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;
}
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests