Unlike MSVC and MinGW, MinGW-W64 version of winuser.h hides MsgWaitForMultipleObjects behind #ifndef NOGDI.
This causes unwanted MinGW-W64-only workarounds in software that wants to compile under MinGW-W64.
For full story, please see relevant thread in git mailing list:
http://git.661346.n2.nabble.com/PATCH-v2-MinGW-W64-cross-compilation-tp7609085p7609093.html
Besides MsgWaitForMultipleObjects itself, also these should be moved out from #ifndef NOGDI:
1. MsgWaitForMultipleObjectsEx
2. QS_* defines
I just encountered this problem using a MinGW-w64 gcc 4.8.2 build. Here is a simple test case:
$ gcc --version
gcc.exe (i686-win32-dwarf, Built by MinGW-W64 project) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cat t.c
$ gcc t.c -o t -luser32
C:\cygwin\tmp\ccwZcPpJ.o:t.c:(.text+0x1f): undefined reference to `CharUpperW'
collect2.exe: error: ld returned 1 exit status
$ echo $?
1
$ gcc -DNONOGDI t.c -o t -luser32
$ echo $?
0
Last edit: Tom Honermann 2014-09-26
Diff:
Done, backported the master copy into v3.x.