hello friends today in this tutorial I will basically show you how to set up C+
development environment inside Visual Studio Code text editor with the MinGW compiler so MinGW compiler guys it's a main compiler for running C+
applications inside our Windows application so C++ is a very famous language you can see it's a high level general purpose programming language and
we will be setting up the development environment for Visual Studio Code text
editor it's a most commonly used text editor in for building softwares so
first of all you need to go to this link I have given this link in the description of the video so basically the link that we need to go to you need
to go to this website this is the actual website let me zoom this msys2.org
first of all we need to download the MinGW compiler just visit this website
and basically you will basically see this is the installer we will install
exe file .exe file and you just need to click this it will directly download
this file here so you can see the download has started it is just 75.3
megabytes file exe file is there you just need to run the setup after
just we will run this now so click on that run anyway so it will basically run
the setup here and now MinGW compiler will install so this is basically the
setup here click on next here and here it will basically ask for where you to
install it so the default directory it will create it in the C directory so
just don't change it just change it just click next here and then again
click next and then now it will install the MGW compiler guys of C++ so this
compiler is necessary if you want to develop C++ applications inside your
Visual Studio Code text editors so it is just installing the compiler here it is
installing the base packages and libraries which comes with this compiler so just wait for the process to finish once completed you will basically launch
a window where we will actually need to execute a command all the commands that
I will use in this tutorial guys I have given the link in the description you
can check the description of the video to copy all the commands and all the
website addresses so you can see basically the installation has been finished now we just need to click next here and you just need to tick mark this
option by default this option will be tick you just need to tick this option
run this MinGW compiler now click on finish as you click finish guys this
terminal window will open right here now you just need to execute this command
right here in order to install that the command is pacman this command I have
given the in the description so I will just write this command here MinGW 64
dash u crt x86 underscore 64 dash toolchain so this is actual command let
me zoom in guys so that you can write this pacman dash s needed base
devil MinGW so this is actual command you can pause the video and basically
you can write this command and now you need to click enter simply enter ok I
think I made a mistake here let me copy this command here once again the command
is given guys in the description of the video simply paste it and now you will
see this is a correct command so I will enter it so it is saying that there are
19 these are the repositories that you need to install here we need to install
all these repositories so we will simply enter a selection so we will enter it
all to this this will be the download size it will say 171 megabytes so proceed
with installation press Y here to install all this so now basically it
will start installing and downloading all these packages and you will basically
see the progress bar so once it reaches 100% for all the packages guys we can
open the visual studio code text editor and then we can install some extension
so just wait I will not pause the video you just see the full video right here
how these packages are installing because I don't want to pause the video
because some people will say that I am not completing the video so it totally
depends upon the speed of your internet connection so if you have good speed
then this will not take a lot of time so it is just installing those base
packages of the MinGW compiler and once it's completed we can start building
our C++ applications in Windows in VS Code so this makes the development
environment far more easier if you are a C++ developer because you no longer
need to open notepad or any other default text editor you can code it
right here inside VS Code which offers far more intellisense features auto completions we don't need to write code you will get auto completions which
makes the coding experience far more easier so it is just installing it so
just wait for the installation to finish so basically once it is installed we have some commands to basically cross
verify if the MGW compiler has been successfully installed so it will
basically tell you the current version that you have I think just one two three packages are remaining the rest of them is completed
so that's why guys I'm not pausing the video you should definitely see how
much time it takes for a this normal computer or normal internet connection
my internet connection is good but still it takes some time for the
installation of all the packages so I think it takes roughly about 3-4
minutes to complete I never installed it I'm just installing it for the very
first time so that's why I am showing you how much time it take so based upon
that you can just install it on your own machine as well so
so I think it is complete now 56 packages have been installed some
so now it has installed downloaded it so now it is just installing it so
installation I think will not take too much time if you don't want to watch
this guys you can skip this process and when it's completed you can watch it from there but I just want to show you the
complete process how much time it takes so now guys it is completed right here you will see the message printed out
so now what we can do is that we can close this and in the documentation if
you see they have actually shown three commands here basically to check your
MinGW installation whether it's completed or not we have three commands to check the version number GCC G++ and GDB so I will simply open command line
here and simply type these commands right here to simply check my version
number if it is successfully installed GCC dash dash version so it will
basically tell you whether it's installed or not in my case it is not
saying G++ dash version let me see guys what is the problem right here so now to
fix that problem guys as you will see basically it is saying to us that this
command is not there GCC if you just type here GCC version now to fix this we
need to update the environment variable with the actual path of that file so
just go to your C directory the default directory is basically this is the myX
my system 64 this will be the directory in which MinGW will be stored right
here simply open that and go to this directory which is UC RT 64 this this
is the location where the compiler is stored open that and open the bin folder
and simply copy this address this will be the address where we need to update
it inside environment variables so simply copy this and now search for here
environment variable system environment variables click on that and select the path click on edit and click on new and simply add this so just add this click
on ok ok and now if you restart your after making these changes you need to
restart the console and again open that and now type GCC you will basically see
now command will be successful it is saying that fatal error no input file is
there so compilation terminated so we have installed the GCC so we can
basically just see which version is installed so we can simply type here
GCC dash dash version so it will simply tell me which version is installed right
here it is saying that this is actual version 13.2.0 similarly we can check it
for G++ version as well so it is again it is saying 13.2.0 and lastly
GDB GDB dash dash version so again you will see the current version for this is
14.1 so all the three packages are installed and now we can basically open
a new directory where we will actually create our C++ project so in VS code so
simply open CMD and simply say C++ project so here first of all guys we
need to have some extensions go to extension tab here and search for the
extension which is C++ the very first extension which comes right here which
is offered by Microsoft simply you need to install that it comes with all the
intelligence features debugging features and code browser simply click install and now it will install this so it is installing it you you can even
install this also guys which is very much helpful if you have a lot of
extensions that you want to install for your C++ project so simply click on
install this also C++ extension pack it is also offered by Microsoft so all the
Microsoft extensions we have installed in VS code so after you do this guys you
need to restart your VS code simply now restart that again now open and hereby
guys we will actually open create a file you can call this as program.cpp
this is extension for C++ files so it has automatically detected so it is
saying that a pre-release version of C++ extension is available I can say yes
and now we will actually write basically a program of C++ which now let
me say include Iostream these are you can see autocomplete is saying guys
you will see so we can basically write a program of C++ so we are writing it
include string using namespace standard int main vector string message let me
just copy this program here of C++ so it simply prints out hello world on the
screen so basically you will see with the see you out statement if you have
studied C++ you will know what I am doing so just format the document that's
all and now you will basically see the this menu guys two options are there
either you can debug or run the C++ file if I click run here this will
basically here you need to select this first option here simply select that and
now it will basically run this file and it will basically print out build
successful finish successfully now it will basically print out so if I go to terminal here you will see basically this hello world is there
hello C++ world from VS code and the C++ extension so whatever we have
written right here basically we can even change this as well let's suppose I
change this message to this message so once again you can run this in the
terminal so you will basically see Kane Williamson is printed out you will see
that so in this way guys you can basically configure C++ and run a very
basic program in it you can even build out advanced programs as well just it's
your imagination you can build out anything inside VS code I have shown you
how to install the MinGW compiler and then make a hello world program and you
can see automatically this exe file has been generated if I say if I open that
exe file this is the executable file which you can execute on Windows machine
and if I execute that basically it is not basically it has converted into we
have converted the CPP file to exe file so it's executable file so it is opening
it and then closing it so we are not having I don't have much knowledge about
CPP files C++ so we don't need to simply wait for some time to display that
message so in this way guys you can basically make a executable file run the
C++ programs and install the MinGW compiler and configure it inside VS code
thank you very much guys for watching this video hopefully you will like this
video please hit that like button subscribe the channel and I will be seeing you in the next video