In this lesson, we are going to learn how to install and setup C++ IDE and compiler in our computer. IDE stands for Integrated Development Environment. You use an IDE to write programs.
However, you also need a compiler. A compiler enables you to convert your program into machine codes. In this case, the IDE we would use is Eclipse while the compiler would be MinGW.
- First we install the IDE. We would use Eclipse IDE
- Then we install and configure MinGW C++ Compiler
This is because, unlike some other IDEs, MinGW C++ compiler needs to be installed separately.
This installation works for both Windows, MacOS and Linux OS. There are six steps you need to follow to setup C++ IDE and compiler. They are:
Step 1: Install Eclipe: You can download Eclipse from here.
Step 2: Install Eclipse IDE for C++: Simply run the installer and install Eclipse installer for C++. After the installation, you will have a desktop icon with the name: Eclipse Cpp 2018-09.
Step 3: Install CDT: CDT Stands for C++ Development Tools. You need to add it to eclipse. To do this, open Eclipse. Then click on the help menu and choose Install New Software.
Help > Install New Software
In the Available Software Window, in the box next to ‘Work With’ just type CDT.
This would filter for CDT.
This is shown below
Select the first Item that displays. (CDT – http://download.eclipse.org/tools/cdt/releases/9.5)
Then expand CDT Main Features
Select the two items:
- C/C++ Development Tools
- C/C++ Development Tools SDK
This is shown in the figure below
After the selection, the click on Next and complete the installation
Step 4: Download MinGW: Visit the site https://sourceforge.net/projects/mingw-w64/ and download MinGW for 32 and 64 bits.
Step 5: Install MinGW: Run the MinGW installer to install MinGW. I recommend you install it in drive C
Step 6: Add MinGW to PATH: Go to the installation folder of MinGW. Copy the path. Than add it to the path variable.
To do this go to My Computer Properties. Click on the Advanced Tab. Then click on Environment Variables.
Select PATH. Click on Edit. Then click on New. Then path the path you copied. Then click on OK.
At this point, you are ready to write C++ programs!