How to Download and Install C Cpp Toolset ( gcc g++ gdb ) in Windows 10 using mingw-w64 and msys2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to the channel in this tutorial we will see how we can install gcc for writing and executing the cnc plus programs in windows 10 operating system so here we will install the mingw64 and we do that by using the msys2 software distribution and building platform so the first thing that we do here is we will open up any browser installed in the computer i have microsoft edge i'm going to open it up and here we need to enter the web address as mingw minus w64 dot org open up the website and here you guys can see the details about minji ww64 by using this we can get the gcc for 32-bit and 64-bit windows operating system um here you guys can see the details and we will directly go to the downloads and here you guys can see a lot of download options for different opt-in systems and also you guys can see the gcc and mgw version that we get when we install a particular tool chain and the package now here we are interested in msys2 this msys2 is a software distribution and building platform for windows it is a collection of tools and libraries which provide the environment for building installing and running the native windows applications now if you install the gcc by using this method then we will get the latest version of gcc so here we will download this one and also you guys can see other details in here we will click on this ms ys2 and it will take us to this page and it says for installation go to this link you know github so we will click on this link and now we are in the msys2.org and here you guys can see all the details about it and also we guys can see the step-by-step process of installing msys2 and also installing the gcc by scrolling down so here what we do is we will download the installer by using this link so we will download it now if you follow this process and install the packages uh as listed in here then you will get the support for many different languages for example gcse has the tool chain for cec plus plus ada fortran etc etc but in this particular tutorial i'm focusing on c and c plus plus so my goal here is to get the tools required for writing and executing cnc plus plus programs and that's why i will be following just a different approach in here and i will install only the tools that we need for cnc plus plus if you follow this process you know everything listed in here then you will get everything but we will get only some of the packages that we need okay now we will wait for this uh you know installer to download okay now the download is complete i'm gonna close this browser and now we will open up the folder where we have saved our download mine is in the downloads folder so i'm gonna go to downloads and here we have the file that we have downloaded now what we have to do is we have to install this so we will double click on it now it says uh welcome to my 64-bit because i have the 64-bit operating system in here if you have a 32-bit operating system then it may say welcome to msys2 6 32-bit so we will click on next and here it will you know select the folder where it will install msys2 just click on next and here also click on next and it will install the msys2 so we will wait now this msys2 that we are installing uh it consists of a command line terminal called as min tty and also it provides a package management system called as pacman you know if you don't know about them then i highly recommend you guys to you know know about them but uh if you're a beginner you know most importantly the beginners watch this tutorial you don't have to worry much about it just follow the process that we are going to do in this tutorial click on next and now here it says run ms wise to 64-bit again if you have a 32-bit operating system then this message may be different just check this box and click on finish at the same time i'm gonna close the folders that i have opened okay now what i have done is i have increased the font size so that you know it can record it in a much better way and you guys can see the details in here now the first thing that we do is we will update the package database and base packages so all we have to do is we have to type in a command and that is pacman space minus yes capital s then y u and after that hit the enter button now it will display the packages it will update and also the download size total installation size and all this so to proceed with installation we will enter y and we will hit the enter button now it will download the packages and install them now i will be uh you know editing this video so you guys can see this stuff happening very quickly but in reality it will take some time depending on internet connection speed and depending on the server speed and all the stuff so wait patiently for everything to finish now after that here it says some error has occurred according to the website it is an expected error so you don't have to worry much about that uh it will update all the things and it will close the terminal so here enter y and hit the enter button now again the terminal has been closed so now what we do is we will click on the start button and we will go to msys to 64 bit and here we will open up the msys2 msys now again if you have a 32-bit operating system then this folder name may be different i'm not really sure about that um just don't worry about the folder name just open up this program which says msys2 msys okay again we are back in the terminal so here now what we do is we will update some of the base packages for that we just have to type in pacman space minus capital s and then u hit the enter button again it will uh you know display some packages and it will display the total download size and install size enter y to proceed with the installation now again it will download the packages and it will install them just wait for it to finish now it has done installing all those packages now we will close this terminal now again we will click on the start button and we will go to msys2 64-bit and here this time we will open up msi to mingw 64-bit if you are in the 32-bit operating system then you can open up the msys2 mingw 32-bit here since i have this 64-bit operating system i'm going to open up this one so now what we have to do is we have to install the gcc so first what we do is we will search for the packages with the name gcc so we will type in patman space minus capital s and after that lowercase s space and we will type in gcc and we will hit the enter button now it will display a bunch of packages in here and if you closely look at them then mingw32 is for the 32-bit operating systems and mingw 64 is for the 64-bit operating systems and also you guys can see the languages a particular package supports for example uh here we can see ada so if we install this package then we get the support for the other programming language again if you look at if you look at this one then this is for the object you see now here we will search for cnc plus plus so in your computer it may take some time for you to search but here just remember this name it says cc plus openmp and it is for 64 bit if you are in 32-bit then again in this 32-bit section you have to search for this so here it will be this one just look at the packet name here mingw-32 slash mingw minus w64 minus i686 minus tcc that's for the 32-bit and for the 64-bit it is this file so mngw64 slash mingw minus w64 minus x86 underscore 64 minus gcc so we have to remember this name you guys can write it down or you guys can copy only this much is required right click copy again this is for the 64 bit for 32 bit you have to select the package in this 32 bit section after that i'm gonna clear this terminal so that you know we get a clean terminal here so here now what we do is we will install the package that we have seen which supports the languages cnc plus so we will type in pacman space minus capital s space and after that paste the package that we have copied that is mingw minus w64 minus x86 underscore 64 minus tcc this is for the 64-bit for the 32-bit you know you have to paste the packet that you have copied okay after that hit the enter button now it will display some of the packages it needs in order to install the package that we have specified to install so it will display the download size install size we will enter y here and we will hit the enter button and now it will retrieve those packages and it will install them and by the way i'm going to put the link of you know these comments in the description box just in case if you are unable to you know get the packet names then you guys can go to the description of this video copy that command and paste it in your computer okay now we will wait okay now it has installed it now i'm gonna type in the command clear to clear the terminal and here now we can find out the gcc version installed so we will type in gcc space minus minus version and you guys can see we get the 10.2 and this is the latest version of gcc available and similarly we can type in g plus plus space minus minus version and you will get the same thing here so now we have the tool set for c and c plus plus now after this we will install a debugger so that we can debug the code so to do that uh i'm gonna clear the terminal again so before installing we will search for the uh debugger so type in pacman space minus capital s lowercase s space gtb after that hit the enter button and it will display all these packages you know which contain the keyword so and here again for the 32-bit and for the 64-bit you guys can see the uh specific uh packages and the one that we are going to install is uh this one which is mingw 64 slash mingw minus w64 minus x86 underscore 64 minus gtp uh you guys can see the version also and this is for the 64-bit and for the 32-bit uh you guys can find that one here this one and you guys can also note down the um this packet name again if you can't you know copy this from here then i'll put the packet name or the command in the description box you know you don't have to worry about it so here i'm gonna copy this packet name so in this package i'm gonna copy it only this much is required copy that and after that i'm gonna clear the terminal and here now we need to install the gdb so we will type in pacman space minus capital s space then we have to paste the package that we have copied and that is mingw minus w64 minus x86 underscore 64 minus gdp it is for the 64-bit again for the 32-bit one it will be different and i'm gonna post both of these in the description box so after that hit the enter button again it will display some of the packages it has to download and install to proceed with the installation we will enter why we will hit the enter button and then we will wait for it to finish now this installation process is not that tough but we just have to wait for it to download and install the packages so the waiting time is more and all other steps are very simple and this is the last uh installation that we are going to perform in this tutorial so after this we will set up the path environment variable and we are good to go and by the way when you're installing this if it fails to install a particular package from a particular server then it will search for another server for the same package we don't have to do anything it will do all the stuff we just have to wait for the installation to finish okay now it has installed it i'm gonna enter the command as clear clear the terminal so now we can check out the gdb version installed so we will type in gdb space minus minus version and we get the version of gdp installed so now we have seen that we have installed gcc and also we have installed a debugger now this installation process may seem a bit difficult for some of you guys but if you look at the advantage of that then we get the latest version of gcc installed in our computer so now uh we can close this terminal now one last setting that we're gonna do in this particular tutorial is we will set up the path enrollment variable with the location where we have installed gcc gdb so if you don't do that then what happens is we will be not able to run the cnc plus plus program from any folders in this file system now click on the start button search for cmd open up the command prompt and just type in gcc space minus minus version now here it is the version of gcc installed in your computer but if you get an error message like this then we have to do one setting and that is we will close the command prompt then we will go to the location where we have installed msys2 and gcc so if you remember it is in the c drive so open up the c drive and it is the msys64 folder you know if you have a 32-bit then this folder name may be different i'm not really sure so open up the folder which is it says ms5s and here we can see mingw 64 it is for the 64-bit operating system again if you have a 32-bit operating system you have to open up mingw-32 so after that in this mini w64 we will open up the bin folder and we just have to copy the part of this location so here if you look at it then we have the programs called as g plus plus gcc and gdb you know all these tools that we have installed previously so now we have to copy this location so just go to this navigation section and left click in your mouse and it will highlight the path like this right click copy and after that close the window again uh click on the start button and search for environment variable and you will get this option in here which says edit the system enrollment variables click on that and here click on enrolment variables and and go to the system variables search for path click on it once you know it will highlight the path then click on edit it will open up a new window and here click on new and paste the path that we have copied after that click on ok click on ok click on ok now again click on the start button search for cmd open up the command prompt and type in the command gcc space minus minus version and you get this message and it will display the version of gcc installed you know if you get this message previously instead of getting the message stating that gcc is not a valid program name or something like that then you don't have to set the path enrollment variable okay now here we will type in g plus plus space minus minus version and then we get the version of g plus plus installed and also we can type in gtb space minus minus version and we get the version of gdp installed so this is it guys this is how we can download and install gcc set for c c plus plus and also the debugger for cnc plus plus if you like this video hit the like button if you don't like it hit that dislike button if you want to say something then write that in the comment box for more tutorials like this do subscribe to the channel thank you for watching i'll see you later in the next video
Info
Channel: LearningLad
Views: 296,806
Rating: undefined out of 5
Keywords: mingw, gcc, C++, Minimalist GNU for Windows, C Programming, C++ programming, C toolset, C++ toolset, C toolchain, computer programming, programming for beginners, mingw-64, g++, gdb, c debugger, c++ debugger, gdb debugger, msys2
Id: 0HD0pqVtsmw
Channel Id: undefined
Length: 19min 53sec (1193 seconds)
Published: Thu Jan 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.