C++: Getting Started

Hello there! In today's blog, we will learn how to gear up to start learning C++ or essentially any other programming language. If you want to run all your programs using VS code, tag along for a step-by-step guide to setting up and running the VS code app.

The process includes the following:

  1. Downloading MinGW

  2. Steps to install Visual Code Studio

Downloading MinGW

We will start by downloading a compiler, MinGW, which will translate your code from C++ to machine-readable binary code. This compiler, like any other, converts the .cpp file you created through VS Code's help into an executable (.exe) file.

First, we will download the MinGW setup

1.PNG

Click download to get the setup. Once the setup has been installed, run it and press install.

2.PNG

You can change the installation directory if you want and continue.

3.PNG

When the installation is completed, press continue to open the MinGW installation manager.

4.PNG

At this point, you must be viewing a long list of packages right-click each of them, and click "Mark for installation."

5.PNG

Press “Installation” on the top left and click on “Apply Changes.”

1.PNG

A window will open. Press “Apply” again.

2.PNG

After the installation is complete, press “Close.”

3.PNG

Note: If upon pressing “Close,” the setup says that packages will be discarded then repeat the step where you install the packages because some files were not downloaded.

Now open the "bin" folder by going to the directory you installed MinGW.

4.PNG

Click on the top bar of the folder and copy the directory.

5.PNG

Now to set environment variables, follow the steps below:

Search “Environment variables” and open “Edit the system environment variables”

6.PNG

Once a window appears, click on "Environment Variables."

7.PNG

This will cause yet another window to open. Select "Path" under the "System Variables" and then press "Edit."

8.PNG

Another window will open. Click new and paste the copied directory and Press “Ok”

10.PNG

Steps to install Visual Code Studio

Go to https://code.visualstudio.com/download this link and download for Windows, then open the downloaded setup

.

Select the directory where you want to install and press “Next”

Now check all the boxes, specially the “Add to Path” box and press “Next”

Press “Install"

After the installation is complete, check the “Launch Visual Studio Code” box and click on “Finish”

VS code will open.

Now click on "extensions" in the left bar, and search for "C++"

With this, your C++ setup for Windows is complete!