||This article has multiple issues. Please help improve it or discuss these issues on the talk page.
|Original author(s)||Colin Peters|
|Initial release||1 July 1998|
|Stable release||4.7.2 / November 5, 2012|
|Operating system||Microsoft Windows|
|License||Public domain (headers), GNU General Public License (compiler and toolchain)|
MinGW (Minimalist GNU for Windows), formerly mingw32, is a distribution of the GNU Compiler Collection (GCC) and GNU Binutils for use in compiling native Microsoft Windows applications. It carries along a set of freely distributable header files and static import libraries to enable use of the Windows API. MinGW can function either as a cross compiler targeting Windows or as a self-hosted toolchain which can be run on Windows itself.
MinGW was originally called mingw32 (Minimalist GNU for W32), following the GNU convention whereby Windows is shortened as "W32". The numbers were dropped in order to avoid the implication that it would be limited to producing 32-bit binaries, although, as of March 2013, it still is. Colin Peters authored the initial release in 1998, consisting only of a Cygwin port of GCC. Jan-Jaap van der Heijden created a Windows-native port of GCC and added binutils and make. Mumit Khan later took over development, adding more Windows-specific features to the package, including the Windows system headers by Anders Norlander. In 2000, the project was moved to SourceForge.net in order to solicit more assistance from the community and centralize its development.
Programming language support 
However, because GCC does not supply its own C runtime library, MinGW's C compiler currently targets Microsoft's old Visual C runtime library, MSVCRT (the initial target was CRTDLL), which was released in 1998 and therefore does not include support for C99 features, or even all of C89; while targeting MSVCRT yields programs that are as native as possible, the lack of support for C99 has caused porting problems, particularly where printf-style conversion specifiers are concerned. These issues have been partially mitigated by the implementation of a C99 compatibility library, libmingwex, but the extensive work required is far from complete and may never be fully realized.
The MinGW project maintains and distributes a number of different core components and supplementary packages, including various ports of the GNU toolchain, such as GCC and binutils, translated into equivalent packages. These utilities can be used from the Windows command line or integrated into an IDE. Packages may be installed using the command line via mingw-get.
MinGW supports dynamic libraries named according to the
<name>.dll conventions, as well as static libraries following the
lib<name>.a naming convention common on Unix and Unix-like systems.
In addition, a component of MinGW known as MSYS (minimal system) provides Windows ports of a lightweight Unix-like shell environment including rxvt and a selection of POSIX tools sufficient to enable autoconf scripts to run, but it does not provide a C compiler or a case-sensitive file system.
mingwPORTs are user contributed additions to the MinGW software collection. Rather than providing these "add-ons" as precompiled binary packages, they are supplied in the form of interactive Bourne shell scripts, which guide the end user through the process of automatically downloading and patching original source code, then building and installing it. Users who wish to build any application from a mingwPORT must first install both MinGW and MSYS.
The implementation of Windows system headers and static import libraries are released under a permissive license, while the GNU ports are provided under the GNU General Public License. Binary downloads of both the complete MSYS package and individual MinGW GNU utilities are available from the MinGW site.
Comparison with Cygwin 
MinGW forked from version 1.3.3 of Cygwin. Although both Cygwin and MinGW can be used to port Unix software to Windows, they have different approaches: Cygwin aims to provide a complete POSIX layer that provides emulations of several system calls and libraries that exist on Linux, Unix, and the BSD variants. The POSIX layer runs on top of Windows, sacrificing performance where necessary for compatibility. Accordingly, this approach requires Windows programs written with Cygwin to run on top of a copylefted compatibility library that must be distributed with the program, along with the program's source code. MinGW aims to provide native functionality and performance via direct Windows API calls. Unlike Cygwin, MinGW does not require a compatibility layer DLL and thus programs do not need to be distributed with source code.
Because MinGW is dependent upon Windows API calls, it cannot provide a full POSIX API; it is unable to compile some Unix applications that can be compiled with Cygwin. Specifically, this applies to applications that require POSIX functionality like
ioctl() and those that expect to be run in a POSIX environment. Applications written using a cross-platform library that has itself been ported to MinGW, such as SDL, wxWidgets, Qt, or GTK+, will usually compile as easily in MinGW as they would in Cygwin.
The combination of MinGW and MSYS provides a small, self-contained environment that can be loaded onto removable media without leaving entries in the registry or files on the computer. Cygwin Portable provides a similar feature. By providing more functionality, Cygwin becomes more complicated to install and maintain.
It is also possible to cross-compile Windows applications with MinGW-GCC under POSIX systems. This means that developers do not need a Windows installation with MSYS to compile software that will run on Windows without Cygwin.
MinGW-w64 fork 
64-bit support has not materialised in MinGW, but it is included in the fork project MinGW-w64. This project also has a 32-bit version. Both versions include updated definitions necessary for supporting parts of the Windows API added in more recent versions of Windows.
See also 
- "MinGW". FedoraProject. 2012-02-06. Retrieved 2012-07-09.
- Stallman, Richard (2000-09-18). "Libtool Re: Naming a project gnu-win32?". libtool mailing list. https://lists.gnu.org/archive/html/libtool/2000-09/msg00000.html. Retrieved 2013-05-21.
- "FAQ". MinGW. Retrieved 2012-07-09.
- "History". MinGW. Retrieved 2012-07-09.
- "Project of the Month". SourceForge.net. Retrieved 2012-07-09.
- gcc (2010-06-21). "C99". MinGW wiki.
- "MinGW - Minimalist GNU for Windows - Browse Files at". Sourceforge.net. Retrieved 2012-07-09.
- "MinGW Command Line Interface Installer". Retrieved 14 June 2012.
- "MSYS". MinGW. Retrieved 2012-07-09.
- "MSYS". MinGW. Retrieved 2012-07-09.
- "MSYS". MinGW.org. Retrieved 2011-05-20. "A common misunderstanding is MSYS is "UNIX on Windows", MSYS by itself does not contain a compiler or a C library, [...] nor does it provide any UNIX specific functionality like case-sensitive filenames."
- "mingwPORT". MinGW. Retrieved 2012-07-09.
- "Licensing Terms". MinGW. Retrieved 2012-07-09.
- "Cygwin". MinGW. Retrieved 2012-07-09.
- "Features/Mingw-w64 cross compiler". Fedora Wiki. Retrieved 15 July 2012.
- Sundin, Stefan. "MinGW and mingw-w64". Retrieved 15 July 2012.