Hey there, fellow programmer! This article will help you set up one of the most famous programming languages, C++. C++ is famous for its high execution speed and complexity ;P

Follow these steps carefully because in a moment, you are going to realize what makes C++ so difficult to learn. It’s because half the people who are willing to learn it, can’t get it installed.

Note: No matter how carefully you follow these steps, you are going to run into some sort of error. If you encounter a problem that is not mentioned in this article, you can reach out to me in the comments or just do a simple google search. Websites like Stackoverflow should be able to help you out.

STEP 1: INSTALLING MINGW

MinGW is an excellent compiler that provides useful tools for languages like C, C++ and FORTRAN. We need to install this first in order to write a C++ code. A compiler is basically a program that will convert your code into a language that a machine can understand.

  1. Download MinGW and install the setup file. Install MinGW in the default directory which should be ‘C:\MinGW’. 

  2. Then the ‘MinGW Installation Manager’ pops up. Select ‘All Packages’ from the left side bar. 

  1. Then, look for ‘GNU C Compilers’ and ‘GNU C++ Compilers’, and select them all by clicking on the check box for each file and select ‘Mark For Installation’.

  1. Next, click on ‘Installation’ on the top bar and select ‘Apply Changes’ and wait for the installation to complete.


STEP 2: CMD COMMANDS

Open command prompt as an administrator.

Execute the following commands one-by-one:

gcc –v

g++ -v                                               

STEP 3: FIXING ERRORS

If you are lucky enough you will get results without any errors (No one is that lucky). But if you run into an error, you can do a simple google search and you should be able to find solutions on the internet.

The thing is, you can encounter almost any kind of error depending on your system and its configuration, but if you need some help, just drop a comment and I’ll help you out with your problem. 

When I first installed C++ and executed these commands, I got something like, ‘gcc is not recognized

If you get this error, just add MinGW’s ‘bin’ folder path to the system’s Environment Variables.

You can follow these steps to add it to Environment Variables:

  1. Locate the ‘This PC’ icon on your desktop or search for it in the start menu

  1. Right-click on it and select ‘Properties

  1. Then click on ‘Advanced System Settings

  1. Now, click on ‘Environment Variables

  1. In the System Variables section look for ‘Path’

  2. Create a new path and paste the MinGW ‘bin’ directory. If you used default settings while installation, it should be something like ‘C:\MinGW\bin’. Create another path and add ‘C:\MinGW\msys\1.0\bin’ (Before adding these paths, cross-check the directories for your system. These file paths are only valid if you used the default settings)

  1. That’s it!! This should fix the error. Now run the cmd commands again and see if it works.

STEP 4: INSTALLING AN IDE

The final step is installing an IDE (Interactive Development Environment). An IDE is the software that’ll provide a suitable interface for you to write and execute your programs. There are many IDEs you can choose from. I prefer Sublime Text 3 for its multiple language support and simplicity. 

The best IDE for C++ is Eclipse. You can download the complete zip file from the official website. It is a two-step process thereon:

  1. Extract the zip file

  1. Navigate to the extracted folder and run ‘eclipse.exe’ 

  1. Choose a workspace for your system. This is where all your projects will be saved. Now, you can start working on your C++ projects with eclipse.

CONCLUSION:

Congratulations!!! You have successfully installed C++ in your system and are now ready to execute your very first C++ program. We will create our first C++ program and learn the basics of C++ in the upcoming lessons, so stay tuned!!

Follow Noob Code Pro for more programming and tech related knowledge. Dropping a like is one way to show some appreciation ;)

Did you run into any error while installing C++ or Are you the luckiest person on Earth? Let me know in the comments below :D

Looking for a programming community to join? Join Noob Code Pro’s Official Telegram Group today and get instant access to our chats and discussions. Hope to see you there!!

I’ll be back next week with some new information to share with you until then……

HAVE AN AWESOME DAY!!!