4 January 2011 Comments Off

How Install C/C++ Compiler by Max Berger

Max Berger, who is currently a Software Developer at Amazon EU, has written a nice tutorial about installing C/C++ compiler. Here we quote this tutorial:

“(…)Setting up a compiler

Unfortunately Eclipse only provides the Integrated Development Environment (IDE) but it is missing the actual compiler. To install a compiler, please follow the instructions for your operating system.

Windows compiler

Windows doesn’t come with a build-in compiler. You could try to install Visual Studio, but it is tricky to get that working with Eclipse. Therefore we will install MSYS. MSYS is part of the MinGW suite, which provides free development tools for Windows.

You will have to follow these 4 steps:

  • Download and install MinGW
  • Download and install MSYS
  • Set your path environment variable
  • Restart Eclipse if it was started.

MinGW

First, you need to download MinGW. You can either click through the websites mentioned above or go directly to the MinGW download area. Look for the Package “Automated MinGW Installer”. There, download the file ending in .exe. The file name should be something like “MinGW-5.1.4.exe”. You can also download MinGW Version 5.1.4 from the link given here.

You may also download an older version, and follow the instructions given in the section called “Older Instructions”:

Most of the options in the MinGW 5 installer are pretty straightforward. I will point out some of the more tricky options.

The first one of such options is which “MinGW” package to install. Any of those should work just fine, but I would recommend Current.

Figure 1. MinGW 5 install

MinGW 5 install

MinGW will ask which components to install. Either select All or at least make sure that you have the g++ compiler checked. This is needed for C++ support.

[...]