Original Post
🔒 Locked
gettimeofday() undefined!
Advertisement
Quote:
I'm trying to use the function gettimeofday(), but I get an error saying it's not defined. It should be in, but It's not in there. I think I probably have an old time.h, but when I replaced it, I just got more errors. Anybody have a solution to this problem?
What compilier do you have?
Header files only contain declarations, not actual code definitions.
Replacing just a *.h file may cause problems when linking with
the libraries.. (ak, undefined symbols useally)
Apparently the C runtime of MinGW consists of whatever is in msvcrt.dll, and AFAIK Microsoft doesn't provide an implementation of gettimeofday(2), which makes sense as it's a SVr4/4.3BSD/POSIX API. Your only options on Windows are probably to use Cygwin (if you aren't bothered by the GPL license and the runtime impact) or to implement your own version of the function.
Hope this helps.
Hope this helps.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement