MinGW


Introduction

This is a port of the GNU C/C++ Compiler to Windows. It's an acronym for "Minimalist GNU for Windows". I just recently downloaded this compiler and I am currently using it exclusively to stress test it's strengths and weaknesses. I found it to be mostly contrary to my previous assumption that it would not be so easy to get and use. I found this compiler to be gotten easier than any of the other ones and immediately responsive to usage.

However, in using this compiler you should direct most of your questions to the GNU C/C++ Compiler because MinGW is a Windows port of that. Otherwise you'll find the amount of information about MinGW itself limited at best and practically useless.

Obtainment

You can visit it's Official Home on SourceForge at http://sourceforge.net/project/showfiles.php?group_id=2435&release_id=15084. There you'll find a list of files and small informational bits about them.

Or you can download the chunk that I put together (under 6 megs). It contains binutils-2.10.91-20010114.zip, gcc-2.95.2-20001116.zip, gcc-f77-2.95.2-20001220.zip, gcc-objc-2.95.2-20001219.zip, ld-2.10.91-20010126.zip, libbfd-2.10.91-20010121.zip, and mingw-runtime-0.5-20010221.tar.gz, and w32api-0.5-20010301.tar.gz. I have not yet applied the patch gcc-2.95.2-mingw-2.95.2-1.diff.gz.

Installation

Easy cheesy.

  1. Download MinGW.zip and unzip it to C:\.

  2. Open up the file C:\AUTOEXEC.BAT. Insert the following line at the beginning of it:

    PATH=C:\mingw\bin;%PATH%

  3. Restart your computer.

  4. Open up a console window and type the following:

    gcc -v [enter]

    You should get the following output:

    Reading specs from C:\MINGW\BIN\..\lib\gcc-lib\mingw32\2.95.2\specs
    gcc driver version 2.95.2 19991024 (release) executing gcc version 2.95.2-20001116

    Yay! It is successfully installed!


Build Program: From Single File

See GNU C/C++.

Links

MinGW Official Homepage

GNU Make

I figured MinGW would come with a ported copy of GNU's Make utility (see Official Homepage for more), but it doesn't. So I went to an FTP mirror and downloaded the source. Unfortunately it requires you to have a copy of make to make make (ack!). Either that or you have to have Cygwin ports of Linux software, like the Shell. OR if you have DJGPP it works with that too (has a batch file). But no MinGW! So I sat down and wrote a batch file to build it. I also copied the config.h.w32 and added a couple lines so that it would bloody work. Anyway, here are some instructions on building GNU Make with MinGW:

There is one problem I have found with the make.exe that is built. If you type make in a directory containing a makefile file, it will say "No targets". You have to explicitely specify the make file:

make -fmakefile

Other than that it appears to work fine. Let me know if you have any problems.