I'm wondering in what situations one uses Cygwin to compile C code and when one would opt for MinGW. I came over What is the difference between Cygwin and MinGW? describing the differences between Cygwin and MinGW.
As far as I understood, one could say the following:
- Cygwin: Allows compiling C source code for POSIX compliant operating systems to run on Windows (requires the cygwin1.dll). For example, I could compile an application using the pthreads API for Windows, although Windows itself does not implement the API.
- MinGW: Allows compiling Windows compliant C source code. So using the example from above, I could not use the pthreads API when compiling with gcc in MinGW but would be required to use the threads API offered by Windows. Instead of using the MinGW gcc compiler, I could also be using a different compiler, e.g. the one that comes with VC++.
However, my understanding seems to be wrong, because I was able to compile a dummy program that included pthread.h with MinGW. What did I understand wrongly?