However, the thread part of IlmBase uses that preprocessor code:
#if defined _WIN32 || defined _WIN64
#ifdef NOMINMAX
#undef NOMINMAX
#endif
#define NOMINMAX
#include <windows.h>
#include <process.h>
#elif HAVE_PTHREAD
#include <pthread.h>
#endif
With MinGW pthread flavor, _WIN32 is always defined, and autoconf properly sets the HAVE_PTHREAD macro. Which means both are defined. The above preprocessor code then includes the Win32 API which is incorrect, causing compile errors. Replacing the whole preprocessor
block by:
#include <pthread.h>