Dear MinGW developers,
I'm trying to compile an application with MinGW as packaged with Cygwin:
The following simple test case:
#include <time.h>
int main()
{
struct tm tm;
_mkgmtime(&tm);
}
fails to compile with the following error:
$ i686-w64-mingw32-gcc -o test.exe test.c
/tmp/ccOjOHdH.o:test.c:(.text+0x16): undefined reference to `_mkgmtime'
collect2: error: ld returned 1 exit status
As far as I can tell, I'm including the correct headers. I also tried the first sample application at https://msdn.microsoft.com/en-us/library/2093ets1.aspx, and it fails to link with the same error.
Interestingly, the 64-bit version of this compiler (x86_64-w64-mingw32-gcc) appears to work fine! I suspect there is a problem with the aliasing of symbols in time.h. I can see that there are inline redirections to _mkgmtime32/_mkgmtime64 which are only active if __CRT__NO_INLINE is not defined, but I can't figure out how to get it undefined. Compiling with -finline makes no difference to the error messages.
Thanks in advance for your help!
Cheers, Chris.
The headers in question are not maintained by MinGW.org; this is not our bug.