Link-time error: undefined reference to `_gettimeofday_r'

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
nangsuep
Posts: 1
Joined: Sat Jul 03, 2010 12:27 pm
Contact:

Link-time error: undefined reference to `_gettimeofday_r'

Post by nangsuep »

Hello,
I have the code below which can be compiled (using arm7-comp.bat) without error:

Code: Select all

#include <time.h>
int main(){
  time_t t;	//time_t is "unsigned long"
  time(&t);
  return 0;
}


However, at link time, it gave me the following error:

Code: Select all

C:\PROGRA~1\MATRIX~1\Flowcode_ARM\Tools\MX_bats\..\arm-elf\lib\libc.a(time.o): In function `time': 
time.c:(.text+0x1c): undefined reference to `_gettimeofday_r'

Thanks in advance,

Phaderm

Post Reply