0% found this document useful (0 votes)
99 views5 pages

Mingw, A Contraction of "Minimalist Gnu For Windows", Is A Minimalist Development Environment For Native Microsoft Windows Applications

This document summarizes the steps to install MinGW, a minimal C++ development environment for Windows. It describes downloading and running the MinGW Installation Manager, selecting packages to install, adding paths to the system PATH variable, and testing with a "Hello World" program compiled and run with g++.

Uploaded by

sancrisxa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views5 pages

Mingw, A Contraction of "Minimalist Gnu For Windows", Is A Minimalist Development Environment For Native Microsoft Windows Applications

This document summarizes the steps to install MinGW, a minimal C++ development environment for Windows. It describes downloading and running the MinGW Installation Manager, selecting packages to install, adding paths to the system PATH variable, and testing with a "Hello World" program compiled and run with g++.

Uploaded by

sancrisxa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

I am currently working for the first time with the programming language C++ in an

enterprise environment. Therefore I will also privately focus more on C++ and related tools
in the future. For that reason I want to write some blog articles in the future, which should
serve me (and maybe you - the reader) as notes.
In this article I describe the installation of Minimum GNU for Windows (MinGW). In following
articles I will describe how-to use NetBeans IDE for C++ software development and how-to
build and use popular C++ libraries, such as Boost.
So, lets start with the installation of MinGW.

MinGW, a contraction of Minimalist GNU for Windows, is a minimalist


development environment for native Microsoft Windows applications.
Note: Alternatives for C++ development under a Microsoft Windows operating system
are Cygwin and Microsoft Visual C++. Cygwin is an attempt to create a complete
UNIX/POSIX environment on Microsoft Windows, whereas Visual C++ is a compiler for
Microsoft Windows. MinGW contains MSYS, which is also a UNIX/POSIX environment for
Windows. But in contrast to Cygwin, MSYS is more compact. Nowadays all the MSYS
components can be installed via MinGW.
1. Download the MinGW Installation Manager Setup Tool (mingw-get-setup.exe)
from the official download URL. The current version is 0.6.2-beta-20131004-1.
2. Run mingw-get-setup.exe.

1. Select the button Install. The dialog Step 1: Specify Installation Preferences is
opened.
o

Enter C:\dev\MinGW (or any other valid directory name in the text
input Installation Directory.

Check all checkboxes.

1. Select the button Continue. After the installation is finished, the window MinGW
Installation Manager is displayed.
o

Select the list item Basic Setup in the listbox on the left.

Check the following checkboxes in the listbox on the right:

Package mingw-developer-toolkit; Class bin

Package mingw32-base; Class bin

Package mingw32-gcc-g++; Class bin

Package mingw32-gcc-g++; Class dev

Package msys-base; Class bin

1. Select the item Apply Changes below Installation in the menu bar. The selected
packages are installed.
2. Add the path of the MinGW and MSYS bin directories to the user environmental
variable PATH. I recommend to define and/or modify the following two user
environmental variables:
o

MINGW_HOME with the value C:\dev\MinGW.

Append %MINGW_HOME%\msys\1.0\bin;%MINGW_HOME%\bin to PATH.

3. Log-off from Microsoft Windows and log-in again.

And thats it. We have successfully installed MinGW. Now we can test compilation, linking
and running of a C++ application. Of course, we will do that by implementing Hello
World(what else?).
1. Create a new file hello_world.cc with the following content:
2.

#include <iostream>

3.
4.

using std::cout;

5.

using std::endl;

6.
7.

int main(int argc, char** argv) {

8.

cout << "hello, world" << endl;

9.

return 0;

10. }

11. Open a command prompt (cmd.exe).


12. Compile, assemble and link the source file with with g++ (GCC), by running the
following command:
13. g++ -o hello_world.exe hello_world.cc

14. Run the executable:


15. hello_world.exe

The following should be printed to the standard output:


hello, world

Impressive. We have successfully implemented our first C++ application with MinGW.
Prepare for some more C++ stuff in the future!

You might also like