Zhixian's Tech Blog


Git as an alternate way to get MinGW

Filed under: computing — Tags: , , , — Zhixian @ 00:41:07 am

In my last blog post, I mentioned about install MinGW to have a C/C++ development environment.
I mentioned that the fastest way is to run the MinGW automated installer.
After I shutdown my PC, I thought of another way to get MinGW working on the PC.
That is, getting a MinGW via Git.

What is Git?

Git is a distributed version control system (DVCS for short).
As the name may suggest, the goal of such a system is to manage the various versions of your documents.
The concept of version control is not exactly new but prior to the advent of DVCSes, they exists mostly as monolithic entities that stand alone.
To manage the different versions of a file, you must be connected to the server to properly manage the various versions.

Pros & Cons of using Git to install MinGW

  1. PRO: Installation process is even more straightforward (you simply have to specify the installation directory).
    CON: Weaker control over the installation process (you cannot elect to install the Fortran or Objective-C options).
  2. PRO: The installer itself contains all the necessary files (hence removing the need to be connected while doing installation).
    CON: You are installing a fixed set of features.
  3. PRO: Comes pre-installed with a default set of useful tools and software.
    CON: Used up much more disk space (1+GB as compared to 308MB for a full MinGW installation)
  4. PRO: You get a DVCS in the process.
    CON: You may not need one in the first place.

The biggest annoyance I find with trying to use Git as development environment is you do not know what exactly is installed.
For example, I would not know if it has objective-C or Fortran compile (no in both cases).


Installing MinGW

Filed under: web application development — Tags: , , — Zhixian @ 21:50:07 pm

This is a blog post on installing MinGW.

  • Short introduction to MinGW
  • Getting MinGW
  • Installing MinGW using the automated installer

Short introduction to MinGW

MinGW is a contraction for "Minimalist GNU for Windows.
The goal of MinGW is to provide a minimal development environment on Windows based on GNU utilities that are commonly found in Unix/Linux platforms.
Its important to note the MinGW is an environment provided on top of Windows. It is not a replacement for a Unix systems nor is it POSIX (Portable Operating System Interface for Unix) compliant. For a POSIX compliant development environment on Windows, you would have to look at cygwin (http://www.cygwin.com/).

Getting MinGW

To install MinGW, I recommend you use the automated installer that can be found in Sourceforge.
This is the fastest way to get a working MinGW environment.

Note: This installer is a downloader front-end.
That is to say, based on the options that you selected in during the installation process, the installer will download only those selected components over the Internet. This process assumes you are connected to the Internet while doing the installation.

The other (more tedious) way is to download each of the required runtime and install it from them.
MinGW’s website has something on this process here. So I will not repeat that information here.

Installing MinGW using the automated installer

After you download the automated installer, you have have an executable like the following:


Double-click on this executable to start the installation process.


After the installer startup, the first 2 steps are typical of every Windows installation.
Just click on the Next button to proceed.

mingw-installation-step1 mingw-installation-step2

The 3rd dialog may be a little confusing.
Its asking if you want to get the latest version of MinGW files or if you would rather get the version of MinGW files associated with the installer.
This is a matter of necessity/preference really. I typically select using the pre-package repository catalogues (ie. the version of MinGW files associated with the installer). After clicking on the  desired radio button option, click on the Next button to proceed with the next step.


This step is the EULA (End User License Agreement), click on the Next button to proceed after you read through it.


The next step is to decide the location to install MinGW in. The default is MinGW directory.
You can pick another directory but preferably one without spaces in it (eg. C:\GNU\MinGW)
After you decide, click on the Next button to proceed with the next installation step.




The next dialog ask which folder do you want to put the shortcuts for MinGW in your start menu.
Click on the Next button to proceed with the next installation step.


You select the components that you want to install for MinGW in this step.
The default installation only install the C Compiler.
In addition, I would also recommend getting the C++ Compiler and MSYS Basic System.
Update (2011-07-09): The MSYS Basic System is really a basic system. It does not even come with a text editior.
As such, I am correcting my recommendation to include the MinGW Developer Toolkit option.

If you are need a Fortran compiler or Obj-C compiler, feel free to add those options.
Click on the Next button to proceed with the next installation step.


After you selected your desired installation options, the next dialog screen will provide a checklist of items for user to check through the items to install.
After you click on the Install button, the install will proceed to download the packages from the Internet.

mingw-installation-step8 mingw-installation-step10

After all the necessary packages are downloaded, you will get the below dialog.
Click on the Finish button to complete the installation process.


Blog at WordPress.com.