Public Group

# Undefined reference to 'gettimeofday'

This topic is 4227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey folks! I'm currently working on a project that requires calls to a Fortran90 function library written by my supervisor at university. When building my project however I'm coming across the following errors: C:\Program Files\MSc Applications\gfortran\lib\libgfortran.a(system_clock.o)(.text+0x18): In function *__gfortran_system_clock_8': C:/msys/1.0.10/home/coudert/ibin/i386-pc-mingw32/libgfortran/../../../trunk/libgfortran/intrinsics/system_clock.c:137: undefined reference to gettimeofday' C:\Program Files\MSc Applications\gfortran\lib\libgfortran.a(system_clock.o)(.text+0xf8): In function *__gfortran_system_clock_4': C:/msys/1.0.10/home/coudert/ibin/i386-pc-mingw32/libgfortran/../../../trunk/libgfortran/intrinsics/system_clock.c:74: undefined reference to gettimeofday' Would anybody happen to know which library 'gettimeofday' is part of so I may link it into my project? Thankyou for the help, it is very much appreciated!

##### Share on other sites
You will need the line:

#include <time.h>

Or something very much like the above.

##### Share on other sites
Quote:
 Would anybody happen to know which library 'gettimeofday' is part of so I may link it into my project?

gettimeofday is a unix function found in sys/time, I know that using cygwin on my box gettimeofday does not work as it returns zero.

1. 1
2. 2
Rutin
23
3. 3
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633653
• Total Posts
3013159
×