do_gettimeofday()undefined reference

anu4 s arpalla at gmail.com
Sat Oct 3 22:22:41 UTC 2009


Hello:
I am new to linux and facing a simple compile problem. I have written a C
file which is using the do_gettimeofday() function.

#include <linux/time.h>
#include <stdio.h>

main()
{
   struct timeval start;

   do_gettimeofday(&start);
   printf ("%d", start.tv_usec);
}

gcc a1.c --
 undefined reference to `do_gettimeofday'


here is the PATH:

echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/homes/iws/arpalla/bin

I checked that the /usr/include/linux/time.h file got the function
declaration for do_gettimeofday()

Is there anything missing in the PATH variable?

I am facing same error for rdtscl() function as well!!

The Linux version is :

[arpalla]$ uname -a
Linux <..> 2.6.30-2.0 #6 SMP Mon Sep 21 11:03:44 PDT 2009 i686 i686 i386
GNU/Linux

Can anyone please help?

Thanks,
Anu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20091003/ceeb4f64/attachment-0001.html 


More information about the users mailing list