How to install MSYS2 and configure it in Visual Studio Code to run C/C++ code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Pawn from amitronics so today in this video tutorial I'll will show you how we can uh basically install msis 2 and uh we will just uh uh how will we integrate with vs code in it last in the last video we uh saw how we can uh configure MW and uh run the GCC command on it so in MW basically uh we have GCC compiler uh included in it but in MS2 if you will download and install how you will through bash how will you get GCC compiler and all you will see that thing so first for msis 2 if you want to install you just go to Google and type msis 2 um download uh for Windows 10 okay so we'll get the first link here and here we'll just get the download the installer part so here uh it is just uh downloading uh first we need to just uh uh check the location we will just uh install it documents and U uh we will just click on save so it's just uh downloading is started and uh it will take around some few minutes uh so let it happen so I'll just fast forward this video for you so uh okay we just got this m to here so we'll just double click on it and uh we'll just install it uh here's the welcome screen so I will click on next and uh it will be installed in C mc64 so we will click on next and again next and it is just installing the bash you can click on show details so it's uh uh installing so again I'll just fast forward this thing so it is uh installation is finished we can click on next now and uh finish so here the M uh screen uh we'll get so we'll minimize it now and what will we do we will just open our uh first we'll check where our installation is location is located so we'll just click on C drive and we'll see this here's the folder mc64 uh here we can see MW 64 and MW 32 if I click on MW 64 and Bin so here bin folder is empty uh so so uh it means there is no GDB GCC configuration happened so what will we do we'll just click on V first we'll just see open V Visual Studio code and uh in Visual Studio code uh let me just yeah Visual Studio is open and uh here uh what will we do we will just open uh I will just click on this uh like uh open folder uh before that what will we do we'll just click on extension and in extension we'll see cc++ this also you need to install uh this is uh uh this is the extension intelligence and uh in here if you just scroll down then uh you will see how uh we can uh get GCC and MW uh w64 on windows so if you click on this uh we will just uh we uh get to this thing in browser so here you can follow these instructions using GCC with MW so here in this tutorial prerequisites here you have Visual Studio in studio code installed uh now extension is also installed now what you need to do uh latest version of msis 2 uh and uh uh what we will do we will just give this Pacman command uh on the terminal which we just minimized so here this uh in this we'll just uh paste that command and we'll hit the enter and here you will see uh these are the things so here it is asking for the selection so we will just uh click on the default selection so for that we need to just hit the enter and here it will ask proceed with the installation we will say yes uh so we will type why and again we'll hit the enter and now it is a starting uh starting installation as you can see so it will take a bit time uh depending upon the computer uh speed and network speed so let's uh let's see and uh we will just wait wait for uh uh wait to finish this installation so I'll just uh fast forward this thing also and we will just see after that how we will uh get we will do the installation process uh forther uh to run any c code on or C++ code in V vs code so these are the errors we are getting but again it is also trying to resolve that so 58 it is attempted and now again uh installing 58 so okay uh I'll just pause pause the video and uh let it happen so uh till 49 packages are installed and till 58 it will go okay okay so it's completed as you can see running post trans transaction Hooks and uh uh after that uh now what will we do we will just look on our that folder U so here uh I will just uh see here in the bin folder now now here you can see in this bin folder all the GCC and uh this uh executables are there now and in same as the this 32 also we will see uh okay not for 32 because we have installed for 64 bit so okay so what will we do we will just uh go to this and here we will just double click on this uh first we'll check the command on the command form how things are working in GCC so if I'll just type GCC version so here I'll get this uh this thing like uh GCC uh this Foundation there is no means like I'm already getting this uh thing in here so uh okay so uh even without setting the environment variables we are getting the GCC version of msis 2 as in the site also they have mentioned like the MS environment contains the NX like sien based tools and here this Ms 2 basically environment uh the path variable uh starts with this U rt64 bin then user bin so you'll get all base tools as well as all msis tools so um the thing is uh still we can set the environment variables so how will be uh addit that environment variable so we'll just copy this and we'll just click on this addit and here we will go to environment variables click on path add it and uh and new okay and again okay now this this is the thing and uh so now we can uh go to uh vs code and here if I like GCC version so here I'm also getting this uh vs code we can compile this uh using GCC and now we will just execute this so hello world is printed so this way we can uh install that this mss2 and uh in V vs code how to execute any code uh for vs code installation and all you can uh just watch my previous video uh that's very easy how to do it and there I have just integrated directly that MW compiler in vs code so thanks for watching in this video
Info
Channel: Embedotronics Technologies
Views: 5,262
Rating: undefined out of 5
Keywords: visualstudiocode, mingw, msys2, ccpp, cpp, programming, coding, embedded
Id: x5DDTzYBXN0
Channel Id: undefined
Length: 10min 2sec (602 seconds)
Published: Mon Sep 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.