
It's quite reasonable to build things on operating system X version N and have it run on operating system Y version M. Compiler running on Linux and producing binaries for Windows is a common beast.
I think this is not true:
I've used such a cross-compiler personally. It works and the produced binaries run on Windows.
UNIX : socket(). WIN: WSASocket()
And? When you're building for mingw using Linux-hosted compiler, the set of header files and functions and preprocessor defines is the same as if you was running Windows-hosted compiler.
You have to insert your own preprocessor defines - which could be handled better with autoconf. It evaluates if the requested feature is available and produces the output. See my example with strerror/strerror_r in my previous mail. (without autoconf) #if defined (LINUX || Solaris_10) strerror_r #elif defined (Solaris_28 || HP/UX_11) strerror #else ... (autoconf - version) #ifdef HAS_STRERROR_R strerror_r #else strerror #endif