mingw

MinGW , short for Minimalist GNU for Windows, provides a port of GCC to Microsoft Windows, along a shell and a collection of utilities that constitute a typical minimal environment in which to build software with GCC.

Description

MinGW ("Minimalistic GNU for Windows") refers to a set of runtime headers, used in building a compiler system based on the GNU GCC and binutils projects. It compiles and links code to be run on Win32 platforms ... providing C, C++ and Fortran compilers plus other related tools. If you see references to "mingw32" or "MinGW-w64" instead of "MinGW", they are referring to the same compiler system. The project's name changed from mingw32 to MinGW (for 32 bit Windows) and the fork that now supports both 32 and 64 bit is called MinGW-w64 (located here: https://www.mingw-w64.org ). MinGW uses the Microsoft runtime libraries, distributed with the Windows operating system. Unlike other ports of GCC to Windows, the runtime libraries are not distributed using Gnu's General Public License (GPL). You, therefore, do not have to distribute your source code with your programs unless, of course, you use a GPL library in your programs.

In the Internet Archive you can still check out the project history for the interesting story of How MinGW Began: https://web.archive.org/web/20201101014531/http://www.mingw.org/history

See Msys for the relationship of Msys and MinGW.

See Building Tcl/Tk with Mingw for info about building Tcl/Tk with Msys and Mingw.


The precompiled ActiveTcl is a popular alternative to building yourself. As it is built with MSVC, there have been some questions about compatibility for extensions that want to build with mingw or cygwin.

Kevan Hashemi went to the effort of confirming the following using ActiveTcl 8.4.16 ...

I have three libraries (iocpsock, mine from Cygwin and mine from MinGW) and two TclTks (mine from MinGW and Active State's) and therefore six combinations. I tried them all, made some changes, and tried them again. I browsed the web.

My conclusions are these:

  1. For at least the past two years, Visual C++, MinGW, and Cygwin all use the same calling convention by default. The default seems to be caller-cleanup, or __cdecl.
  2. By default, Cygwin-compiled libraries are dependent upon Cygwin API libraries. If you put copies of the Cygwin API libraries in the load path for any non-Cygwin TclTk, TclTk will freeze.
  3. You can avoid dependence upon the Cygwin API libraries when compiling on Cygwin with the "-mno-cygwin" compiler option, but you have to have the MinGW header files available instead (in which case, you could compile with MinGW instead, so why bother with Cygwin?).
  4. I prefer MinGW to Cygwin.

See Also

MSYS
Building Tcl/Tk with Mingw
Also contains information on how to install mingw manually with gcc4.x
cygwin
Cross-Compiling Tcl/Tk 8.3.2 for WinNT [L1 ]
DLL Creation in MingW [L2 ]
critcl