{{Short description|Compiler toolchain for Windows}} {{Infobox software | name = MinGW | developer = MinGW Project | released = {{Start date and age|1998}} | operating system = Microsoft Windows | platform = IA-32 | genre = Compiler toolchain | license = GPL, LGPL, and GCC Runtime Library Exception (compiler/toolchain); mixed, primarily MIT and Public domain (runtime headers) | website = {{webarchive|url=https://web.archive.org/web/20201223203407/http://www.mingw.org/ |date=23 December 2020 |title=http://www.mingw.org/}} {{small|(defunct)}} }}

'''MinGW''' ("Minimalist GNU for Windows") is a compiler toolchain for creating native Microsoft Windows applications. It provides a port of the GNU Compiler Collection (GCC) and related tools that generate executables targeting the Windows API without requiring a compatibility layer or emulation environment.

MinGW was developed to support native Windows development using GNU tools. Unlike POSIX-based environments such as Cygwin, MinGW targets the Windows API directly and does not attempt to provide a full Unix-like runtime environment.<ref name="cygwin_faq">{{cite web |title=How do I compile a Windows executable that doesn't use Cygwin? |url=https://cygwin.com/faq.html#faq.programming.mingw |website=Cygwin FAQ |access-date=2026-04-11}}</ref>

It includes ports of essential GNU development tools, including GCC and GNU Binutils, along with a minimal Unix-like shell environment (MSYS) used to assist with build processes.<ref name="mingw_history">{{cite web |title=History |url=http://www.mingw.org/wiki/History |website=MinGW |access-date=2026-04-11 |archive-url=https://web.archive.org/web/20120823023224/http://www.mingw.org/wiki/History |archive-date=2012-08-23 |url-status=dead}}</ref>

Later projects and distributions such as Mingw-w64 and MSYS2 provide modern, actively maintained environments for native Windows builds using GNU toolchains.<ref name="mingw64_history">{{cite web |title=History |url=https://sourceforge.net/p/mingw-w64/wiki2/History/ |website=Mingw-w64 |access-date=2026-04-11}}</ref><ref name="msys2_intro">{{cite web |title=What is MSYS2? |url=https://www.msys2.org/docs/what-is-msys2/ |website=MSYS2 |access-date=2026-04-11}}</ref>

== Architecture == MinGW is designed to produce native Windows executables rather than provide a POSIX compatibility layer; unlike Cygwin-based toolchains, it links against standard Microsoft DLLs such as MSVCRT rather than a Unix emulation runtime.<ref name="cygwin_faq" />

Because MinGW does not provide a full POSIX environment, applications that rely on strictly POSIX-compliant process management, such as <code>fork()</code>, require modifications to compile or run correctly on Windows.<ref name="cygwin_faq" />

== Toolchain flow == The MinGW toolchain follows the standard GNU compilation pipeline adapted for the Windows platform:

# Source code (C, C++, Fortran, etc.) is compiled by GCC into object files targeting Windows. # The assembler (GNU <code>as</code>) converts intermediate representations into machine code object files.<ref name="binutils_as">{{cite web |title=GNU assembler (as) |url=https://sourceware.org/binutils/docs/as/ |website=GNU Binutils documentation |access-date=2026-04-11}}</ref> # The linker (GNU <code>ld</code>) links object files with system libraries and runtime components.<ref name="binutils_ld">{{cite web |title=GNU linker (ld) |url=https://sourceware.org/binutils/docs/ld/ |website=GNU Binutils documentation |access-date=2026-04-11}}</ref> # Executables are produced in the Portable Executable (PE) format and run directly on Windows without a compatibility layer.

The use of the Portable Executable format distinguishes MinGW-generated binaries from typical Unix systems, which commonly use the ELF (Executable and Linkable Format) binary format.

== Comparison with Cygwin == Although both Cygwin and MinGW can be used to build software for Windows, they have different design goals. Cygwin provides a POSIX compatibility layer and a Unix-like runtime environment on Windows, while MinGW targets the Windows API directly and produces native Windows executables.<ref name="cygwin_faq" />

Programs built with Cygwin typically depend on the Cygwin runtime DLL, whereas MinGW-generated programs do not require such a compatibility layer.<ref name="cygwin_faq" />

== Programming language support == As a port of GCC, MinGW supports multiple programming languages, including C, C++, Objective-C, Objective-C++, Fortran, and Ada.

Compiled programs use the standard GCC runtime libraries, including <code>libstdc++</code> for C++ applications<ref name="gcc_libstdcxx">{{cite web |title=The GNU C++ Library Manual |url=https://gcc.gnu.org/onlinedocs/libstdc++/manual/ |website=GCC online documentation |publisher=Free Software Foundation |access-date=2026-04-11}}</ref> and the GNU Fortran runtime libraries for Fortran applications.<ref name="gcc_libgfortran">{{cite web |title=GNU Fortran and GCC |url=https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-and-GCC.html |website=GCC online documentation |publisher=Free Software Foundation |access-date=2026-04-11}}</ref>

== History == === Early development === MinGW originated in the late 1990s to supply a minimal GNU-based development environment for Microsoft Windows.<ref name="mingw_history" /> The project provided a way to compile open-source applications into native 32-bit Windows binaries.

=== Fork and ecosystem evolution === In 2007, the Mingw-w64 fork was created to add 64-bit Windows support and coverage of newer Windows APIs absent from the original project.<ref name="mingw64_history" /> MSYS2 followed in the 2010s, building on Mingw-w64 while adding the <code>pacman</code> package manager and a modernized distribution model.<ref name="msys2_intro" />

== See also == * Mingw-w64 * Cygwin * MSYS2 * GNU Compiler Collection

== References == {{Reflist}}

== External links == * [https://web.archive.org/web/20120823023224/http://www.mingw.org/wiki/History MinGW project history] (archived) * [https://nuwen.net/mingw.html 64-bit MinGW distro] - maintained by a [https://nuwen.net/stl.html Microsoft employee]

{{Software in the Public Interest}} {{Unix-Windows interoperability}}

Category:1998 software Category:C (programming language) compilers Category:C++ compilers Category:Cross-compilers Category:Fortran compilers Category:Free and open source compilers Category:Public-domain software