https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67114
--- Comment #13 from ralphengels at gmail dot com <ralphengels at gmail dot com> --- Also needs a small change in pthread.h to guard against including windows.h #if defined(PTW32_CONFIG_MINGW) && defined(__cplusplus) change to #if defined(PTW32_CONFIG_MINGW) && defined(PTW32_BUILD) && defined(__cplusplus)