C++: Getting Started
Table of contents
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:
Downloading MinGW
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
Click download to get the setup. Once the setup has been installed, run it and press install.
You can change the installation directory if you want and continue.
When the installation is completed, press continue to open the MinGW installation manager.
At this point, you must be viewing a long list of packages right-click each of them, and click "Mark for installation."
Press “Installation” on the top left and click on “Apply Changes.”
A window will open. Press “Apply” again.
After the installation is complete, press “Close.”
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.
Click on the top bar of the folder and copy the directory.
Now to set environment variables, follow the steps below:
Search “Environment variables” and open “Edit the system environment variables”
Once a window appears, click on "Environment Variables."
This will cause yet another window to open. Select "Path" under the "System Variables" and then press "Edit."
Another window will open. Click new and paste the copied directory and Press “Ok”
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!