This was originally posted on my old blog
2017 update: MinGW 3.4.2 can not compile programs in Windows 10; use a
newer version of MinGW or a Windows XP/Windows 7 virtual machine
2015 update: MinGW 3.4.2 and MSys 1.0.10 are available on my
web page:
I have updated the links below to not link to Sourceforge
Once upon a time, MinGW (a free *NIX-like developing environment for
Windows that allows one to make native Windows binaries using a Linux-like
environment) was very simple to install:
- Download MinGW-3.1.0-1.exe
and MSYS-1.0.10.exe
- Double click on MinGW-3.1.0-1.exe, yes, "I
accept", yes, yes, finished
- Double click on MSYS-1.0.10.exe, yes,
"I accept", yes, yes
- A terminal window opens; usually "y" then
enter so MSYS can see MinGW
- Uncheck the README and other file then
click on "Finished"
Once this is done, you have a blue "M" on your
desktop, which gives you a full *NIX development environment.
It's really easy to use if you're familiar with *NIX development.
First, use an editor and make a file named hello.c that looks like
main(){printf("Hello, world!\n");, then compile the program
with
gcc -o hello hello.c.
OK, some notes that,
in typical open-source fashion, the MinGW developers never bothered
to document. To get out of the *NIX-looking "jail" and access the full
filesystem, go to a directory with a name like "/c" (the C drive), "/d"
(the D drive), and so on. Note that, if you insert a USB stick after
starting the msys command prompt, you will need to close the window
and reopen the window before you can access the drive letter for the
USB stick or what not.
The "jail" where you access files
is usually "c:\msys\1.0" and you start in a directory with a name like
"c:\msys\1.0\home\user" where "user" is your username in Windows.
The window with the terminal prompt is able to copy and paste to and
from other Windows applications, but in a very *NIX-like way: You simply
highlight something with your mouse to copy it to Windows' clipboard;
to paste something from the clipboard in to the terminal window, simply
click on either the middle button of your 3-button mouse (this is the
wheel if you're using a wheel mouse) or both the left and right buttons
at the same time (if you're using a 2-button mouse), and whatever is in
the Windows clipboard will be pasted as if you typed it at the terminal
window.
Well, ever since MinGW 3.1.0-1 and MSYS-1.0.10, the
MinGW developers decided to make the install process more complicated,
requiring downloading one program which in turn downloads whatever the
MinGW developers decide is the current version of MinGW today (which makes
it difficult to have a stable development environment). Fortunately,
one can still readily download both MinGW-3.1.0-1 and MSYS-1.0.10;
the total download size for these two programs is under 20 megs.
Here is a (2015 update: No
longer on Sourceforge) Sourceforge
link to download MinGW 3.1.0-1 (
2015 update: Now links
to MinGW 3.4.2) (The MinGW
developers have gone out of their way to hide this link), and
here
is MSYS-1.0.10.exe (
2015 update: Again, no longer on Sourceforge).
For people wanting to verify these
packages, here are the MD5 sums for these programs:
da686e2c7b283385ef79d7b75afb609c MSYS-1.0.10.exe
585ae4e47d526238fdf8d25ec080d17d MinGW-3.4.2.exe
Here
are the SHA1 sums:
510fcfa923833073bc55302913739e25b909e66a
MSYS-1.0.10.exe
6ae2ce0eca771bdc4b8d09bfe98de7fe452e9d16 MinGW-3.4.2.exe
And here are the
Radio Gatun 32 sums:
6651ecff045db1f946fb801dc81e2da3a84c848747395fe2d647e58ad826f0eb
./MinGW-3.4.2.exe
dff74bc62f2df11becc0b550e952ce3e2f48de092c32cb50e1290e4a38cadc33
./MSYS-1.0.10.exe
(
2015 update: Sums updated to use MinGW 3.4.2)