Version 6 of mingw

Updated 2005-09-09 05:39:44

What is MinGW from the mingw.org site

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" instead of "MinGW", they are referring to the same compiler system. The project's name changed from mingw32 to MinGW is to prevent the implication that MinGW will only works on 32 bit systems (as 64 and higher bit machines become more common, MinGW will evolve to work with them). 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.

Check out the project history for the interesting story of How MinGW Began: http://www.mingw.org/history.shtml .


The msys and mingw download should be used to compile Tcl/Tk sources on a Windows machine. A zip file containing all the needed software is available here:

http://sourceforge.net/project/showfiles.php?group_id=10894

The msys and mingw download available above has been tested with current releases of Tcl and Tk. It is the same software available from mingw.org, except that all the needed software has already been packaged into a single download.


JMN 2005-09-09 Note that if the cygwin utility 'cygpath.exe' exists on your path at the time you run 'configure' in MSYS - then the generated Makefile will try to use cygpath. The makefile will then include the line:

 CYGPATH  = cygpath -w

This appears to be a 'bad thing' because in some cases you end up with trailing slashes stuffing up the gcc commandlines.

 e.g gcc -c -O -Wall -Wconversion -I"./../generic" -I".\"  etc

The trailing backslash above causes the '"' to be escaped and you end up with an error such as:

 /bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
 /bin/sh: -c: line 2: syntax error: unexpected end of file

To fix this, either change the line in the Makefile to read: CYGPATH = echo Or move your cygpath.exe aside during the whole build process.

From what I can determine from the MSYS readme - the cygpath utility shouldn't be required at all when building using MSYS/MinGW:

 "Msys will convert POSIX paths that are used as arguments to Win32 paths.  This is done for any executable not in /bin and /usr/bin.  If the executable is dependant on the msys-1.0.dll then it must be located in the /bin or /usr/bin directory. This means that you now have a POSIX environment that will automagically do the right thing w.r.t. changing the paths passed as arguments."

This issue appears to have been catching people out since at least Oct 2004 : http://groups.google.com.au/group/comp.lang.tcl/browse_frm/thread/7fc961790b53209e/adf411798d9f71c0?lnk=st&q=22cygpath+-w22+makefile&rnum=10&hl=en#adf411798d9f71c0

I don't know enough about the MinGW/MSYS toolchain and the Tcl build process to know where this problem needs to be addressed. Somebody please file a bug report 'somewhere'. :)


See also


Category Porting