How to install Visual studio Code and how to configure MinGW compiler on it for C

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so today in this video tutorial I will show you how we can install Visual Studio code and how we can include Ming GW compiler on it so and we will run one small C test code for hello world code on that so what I'll do I'll just first install Microsoft Visual Studio code so for that we need to go go to Google and type Microsoft Visual Studio code download so here's the first link will Studio code and in this uh we'll click on this windows and automatically it will ask uh further down download thing so now what will we do we will just go to uh any uh anywhere any document and we will download that and we will just click on this document and we'll just click on Save now it's been saved there so what I will do now I'll just go to there and we will just from go to download and we'll just [Music] install it by clicking here okay so so we'll accept this and I click on next okay you can create a desktop icon if if you want to create next next so it's installing uh in a couple of moment minutes it will install maybe it will take less than a minute here so it is installing okay finish now this is our Visual Studio now what we need to do we need to um [Music] install mingw compiler for that so for that uh again we'll go to uh Google here and we'll just um search for Min GW compiler download so this first link will go Source who's net and here we will just download it so it will be downloaded in a second yes again here we need to save this and now we'll just go to our downloads and we'll just click on this installation and will install continue so installation progress is started now it will take a couple of minutes to start it's connecting yeah start it now it will take a Time little time so I'll just pass forward this process for you so it's processing it's happening setup is updating installation is is updating itself and process is going on so it's still processing so yeah you can see it's finished here you can see catalog update completed click check details and paint for errors and now we'll just click on continue and here here these things if you will see that mean GW developer tool mean GW 32 base uh in the last video I showed you how we can uninstall this mini GW so those packages and all will be installed by by click using this these enabling this uh these installer packages so here in the first you can see an msys installation for mgw developer meta a basically installation Adder compiler however we don't need that adder and all or Fortran and all but still I'll select all and you can skip uh if you don't want these things but you can also you can include all those things maybe in later somewhere you need add a compiler so that at that time you don't need to again reconfigure that so I'll suggest you install all the click on all the installer packages so just enable all these things Mark for installation and we'll just oh yeah we login Mark and Mark for installation Mark construction this one also Mark constant for G plus plus DCC and this one so we have marked all these sound compiler 7 installer packages so now what will you do we'll just go to installation and installation we'll just click on apply changes and here you one pop-up window came okay to proceed the packet changes items below will be implemented when you choose apply so we'll click on apply so now here you can see uh it's uh installing all those packages so again now it will take a time so so again I'll just fast forward for you this video also like it install so now you can see that the installation is of all the installer packages has been completed so we can close it now and now uh if I just go to uh I'll just close this window I'll just go to command prompt so here if I just type GCC version so I will see this is not recognized recognized so what we need to do we first we need to just go to that path where this installation is done so we'll just go to that particular path and we'll see how how we can uh just look things I mean I will just go to that particular path and let's see how we can run this GCC thing using this command prompt so here is the thing in this bin folder we have all this GCC and G plus plus exe so I'll just open CMD here and if I write here GCC version so here you can see this is the mean jw.org GCC this one we have found and uh so this here we are not getting any error so what we need to do we need to uh just give this path to our environment variables so what will we do we will just go to edit uh the system environment variables so we will just uh we'll get this window and here in this environment variables we'll click on this and here in the path now we will just click on edit and first let's just come copy this part so not this one yeah so this I have been so this path we need to go and we'll just click and go to here and in path I will click on edit and here we will just add click on new and copy this and click on OK and okay and again okay so now what we need to do we need to just close this CMD and now again we need to restart our CMD now here if I'll just GCC version if I'll see so I can see that here also I am just getting this GCC thing so uh we can say that now installation is completed thoroughly now if we'll just go to our vs code and we'll just run one simple C code Bill using this mingw compiler so let's see how we can do that so one hello world code only you can will write and we will just see how how we can compile using this so what I'll do I'll just click on this folder and open folder and this open folder I'll just let's say in desktop only I want to and create new folder and in this new folder let's say hello world okay so we'll select this folder so our project has been created now I will just hello uh world dot C we'll just click on file and here we just include uh s t t i o dot h so now uh in command and we'll just write one simple program print tab and hello world record zero no okay because we are using int so we need to return also now what we need to do we need to just we need to compile this thing so what what all we need to do we'll just go to this terminal we will just uh go to new terminal and here this folder we will get now here this program we need to compile first GCC so for compilation uh if you are aware of the GCC commands and also for first we need to give output file and then we need to give execute over that dot C file so if we don't will not give any file let's say I'll just give GCC hello uh word so if I'll just do like that so a DOT exe will be generated automatically so recognize as the name of the command so okay okay so we will just uh do one thing we'll just see how in our extension C C plus plus instance is installed or not so this is installed so uh I actually found uh I just find the solution what was the problem basically uh I had I had created project in desktop and desktop was there in OneDrive and then that's why some issues going on with that GCC was not executing in this integrated terminal in this vs code but now the same code I have written and this C project I have created in in D drive and in D drive one folder C project and GCC then I am executing so that was maybe because of in one drive or something something like that um that may be the issue but now I am not getting this error in this integrated terminal as well because in outside Terminal it was working that code was also working if I will show you like if this was the code which actually I have written a hello world in desktop and if I just uh do this thing and here if I'll just do CMD so here basically I can able to run uh this thing uh hello world.c so here also it is making executable so a DOT exe is a it it created executable if I just delete let's say uh uh like that and if I'll run from this command prompt and here I'll do come execute this so it will just create a that Exe on that folder not here here is you can see a DOT exe is created so I can execute this like this if I'll execute um a so I'll get hello world so this is the thing it's not a generated output through vs code because of maybe one because of some path error or maybe this text of hello world and this OneDrive part may be there that's why I'm getting this error but okay now we will just uh do this thing here in this Visual Studio code this integrated terminal we are just executing this command now I'll do this okay dot exe and here [Music] sorry I did not uh run this the first run this now it's executed because I had deleted that now I'll just hey dot exe or even will not give exe then also it will do the task so here you can see hello world is printed so I hope you like this tutorial if you have any doubt regarding this just comment us below thank you guys thank you very much
Info
Channel: Embedotronics Technologies
Views: 1,003
Rating: undefined out of 5
Keywords: mingw, vscode, compiler, mingwcompiler, msys2, gcc, g++
Id: kEXlm24ulG8
Channel Id: undefined
Length: 17min 3sec (1023 seconds)
Published: Mon Aug 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.