How to Download and Install C Cpp Toolset ( gcc g++ gdb ) in Windows 11 using mingw-w64 and msys2
Вставка
- Опубліковано 25 чер 2024
- In this tutorial you will learn to download and install MinGW-w64 ( Minimalist GNU for Windows ) toolset ( ( gcc g++ gdb ) ) for developing C and Cpp programs on windows 10 or windows 11 computer using msys2 Software Distribution and Building Platform.
Topics :
00:00 Introduction and Downloading Msys2
03:12 Installing Mysys2 Updating Packages
07:35 Installing gcc and g++
12:14 Installing gdb debugger
16:00 Setting up Path Environment Variable
18:48 Check gcc g+= and gdb version in cmd
First we will download and install msys2.
After that we use the series of commands to install packages and update system.
Commands used :
Update the package database and base packages using
pacman -Syu
Update rest of the base packages
pacman -Su
Now open up the Msys MinGW terminal
To install gcc and g++ for C and C++
For 64 bit
pacman -S mingw-w64-x86_64-gcc
For 32 bit
pacman -S mingw-w64-i686-gcc
To install the debugger ( gdb ) for C and C++
For 64 bit
pacman -S mingw-w64-x86_64-gdb
For 32 bit
pacman -S mingw-w64-i686-gdb
To check
gcc version : gcc --version
g++ version : g++ --version
gdb version : gdb --version
After installing these programs, we need to set the Path environment variable.
Our Website
www.LearningLad.com
Social Media
Facebook / learninglad
Twitter / learningladedu
Instagram / learningladofficial
This tutorial is the most simple one I think I've ever followed! It's literally just a "do exactly what I do" thing, which is sometimes more helpful than other methods
Thank you
@@LearningLad why i can't install gcc version..? Command not found only displaying on my desktop
@@pavanigogikar5439 same
@@xotic_evil4299 ha I got it..
@@pavanigogikar5439 how
I don't often comment on these types of videos but I must say that you are down to earth and get straight to the point, and I appreciate that greatly. I was able to easily follow your instructions with no issues whatsoever, and I really am thankful that you went the extra step of including the commands in the description. Thank you so much!
It's not safe to directly copy commands from the description box as they're outdated, you should do like him copy them from the terminal.
I struggled for two hours (trying to figure things out) before watching this and your vs code setup videos. Your tutorials are very cohesive and straight to the point. Such a life saver! Many thanks!
most welcome :)
this was the most straight-forward, easy to follow tutorial i have found for this. the online course i signed up for wasn't as beginner friendly as it advertised itself to be, so they didn't walk through how to set everything up. finding your tutorial helped immensely. seriously, thank you so much!
You're very welcome!
If any of you encounter the error "error: failed to prepare transaction (could not find database)" when executing "pacman -Su", just execute the command "pacman -Syy", then proceed with executing "pacman -Su".
This tutorial is awesome! Definitely helped in setting up my programming environment for C++ in VS Code. I swear Indian tutorials in UA-cam are so underrated.
This saved my ass. Thank you so much!
thank you
@PyroXbytZ PXZ admit you already forgot after two weeks
I just typed in pacman -Sy and it worked
like that's what the error told me to type in lol
I couldn't agree with you any less, Indian UA-camrs are so underrated.
And thank you for your input, pacman -Yss worked for me!
Thank you so much for this incredibly helpful installation tutorial! This and your other video on setting up VS Code for C++ are instrumental for me finally running my first C++ program and opening the door for me to learn C++. Thank you so much!!!
Pleasure
I found this video after an hour of searching. As a newbie, this was one of the clearest and best paced videos on the topic of GCC. Well done!
Glad it was helpful!
Great tutorial. Clear, simple, easy to follow, and all information needed was included
This video was probably the most helpful coding related tutorial I have every had. Thanks man!
Pleasure
An amazing tutorial for downloading the compiler, ive been stuck looking at other guides for days and I am so thankful to have found this one! thank you
this tutorial was simple, easy to follow, and super helpful! thank you so much!
You're very welcome!
I'm eternally grateful to you for this video. Setting up C++ has been a pain, but I could follow every single step exactly in this video to set it up, finishing a process that would've otherwise taken hours in 30 minutes.
glad my video helped you :)
@@LearningLad 1 suggestion is, update the commands in the description box. The versions and the commands have changed a lot since 1 and half yr back. While not making a new video is fine, you can update the commands in the description of this video to reflect the new versions or make a comment and pin it here with the new commands.
@@saumyahadani640 /msys64/mingw64/bin/gdb.exe: error while loading shared libraries: libpython3.10.dll: cannot open shared object file: No such file or directory
this error is coming while checking the gdb version
I couldn't relate more to you
This is unbelievably helpful. I spent a whole afternoon frustrated at text and writing and documentation, i forgot how helpful videos can be. Subscribed, and will keep checking your channel for tutorials. Thank you so much
pleasure
keep learning :)
I Can't agree more
i got a similar error because i was getting less than 1 byte a second lmao
The way you explain is pure gold!! Thank you for the time you saved me ❤
You are so welcome!
This is the simplest video that addresses how to install mingw and setup your computer for c and c++ programming. Kudos to the instructor
you are the only one who explained this on youtube very seamlessly THANKS ALOT !
You're very welcome!
I got so discouraged when I first tried installing all of these packages but your tutorial helped out IMMENSELY! I can't wait to start coding once everything is finalized.
All the best :)
Very good tutorial. Beginner friendly, and very step by step. Did not assume I had done any part of the setup already.
thank you :)
After two weeks of crying and tearing my hair, I finally know how to work stuff out! Thanks a lot man. This was so clear-cut and straightforward. Every tutorial should be like this.
Glad it helped!
The entire tutorial was easy and concise to follow. Big thumbs up for your efforts LearningLad.
The best tutorial on this site. For once a tutorial that actually works.
This was the most painLESS process on adding a gcc. I love this tutorial. Very helpful!! Now all I have to do now is set up the Visual Studio. This time, I have a gcc ready to go.
Thank you
Great tutorial, thanks a lot! Also appreciate that you get us to check that it worked using the command prompt. Good stuff.
thank you :)
I needed to do this for my Data Structures course in college and my professor gave no instruction of how to do this. I appreciate you making this video! Very easy to follow and so so so helpful, thank you!!!
You're a breath of fresh air for us struggling with these
Thank you
not the teacher we deserve, but the teacher we need
thank you :)
This tutorial is the most simple one I think I've ever followed! It's literally just a "do exactly what I do" thing, which is sometimes more helpful than other methods".
Great to hear :)
This was so helpful! Will definitely come to your channel first for tutorials next time I need one!
Thanks for this tutorial because I was having a hard time doing the mingw (default and old) installation process as some files were corrupted during the installation or were having errors and this was the best way of installing gcc so far.
and also you got a SUB!:)
Pleasure
You have my respect. This is a really nice tutorial, thank you.
You're welcome!
This video is just perfect. Simple instructions and coherent explanations. On point and detailed.
It is a shame that I have not found this earlier.
thanks
Thank you so much for how comprehensive the tutorial was. Also, adding how to edit Path was a nice touch.
You're very welcome!
This is literally the easiest tutorial video I've ever watched. Thank you!
You're very welcome!
Thank you for this tutorial, it has helped me install this compiler and debugger for Atom. I was feeling a bit overwhelmed but you helped me get trough it. You're awesome
Pleasure
Keep learning :)
thank you for your help. I had no idea that would be that difficult. This is the first time I'm using C++ to get ready for a data structures and algorithms class!
This video saved my life, worth watching every second of it. So lucid and brilliantly explained. Thank you so much. Virtual hugs.
Dude, this video is amazing. Thank you so much sir 🙏🏽🙏🏽
My pleasure!
just 8 minutes into the vedio and already subscribed.REALLY GREAT CONTENT.
Thank you
Keep learning :)
Perfect! Every time I need to install C in a different computer I come to this video. 😊❤
awesome :)
This tutorial helped me a lot! I was searching this for a long time and I found your video! Thank You!
You're welcome!
My download and installation was done exactly when you mentioned some errors, not every day my internet is as fast as the tutorial maker :-) Awesome video, and thanks for the help!
Most of the time, the tutorial maker speeds up the install footage.
I was absent for the basic classes and I missed the installation. You are literally my hero.
glad my video helped you :)
Simple as hell! Every point well explained! Highly recommended and Thank you !
You're welcome!
Thank you so much for the tutorial. As the other comments have mentioned this was extremely simple to follow.
You're welcome!
When Installing a code editor is more difficult than C or C++ XD
Exactly 😹
Kopdi kharab 💥
you're using Windows
🤣🤣🤣
Why is it so unintuitive?
You were so good man..very helpful. Clear sound and clear commands...thanks god bless you
Glad it helped!
Thank you so much for this tutorial man! I could not have used the C compiler without YOU ❤
You are welcome!
Thank you so much! I've been trying to install it for a few days but now I've succeeded and all thanks to you
Pleasure
Bro you're the only one who actually helped me tysm this was such an easy and simple to follow tutorial
glad my video helped you :)
thanks so much I didn't know what g++ was until this video!
thank you so much for making this tutorial, had no trouble following the steps. Saved me tons of time...
You're welcome!
Thank you. This is the best one compared to others. I was breaking my head over why my simple Hello World C program was taking 12 seconds instead of 0.5 or some point odd seconds. The problem was with GCC installations. I think mingw with Mysys2 is a good distribution platform or perhaps it was limited understanding with others.
You really can explain things so good! It was easy to follow, you explain every single step where I could have made a mistake. Thank you!
You are so welcome!
@@LearningLad I completed all steps. Now what to do to run programs?
Soniya\,,
thanku so much after watching around 50 videos now I've been able to install MinGW through your video
You are most welcome
I am thankful for your guide.
Had a massive problem with my previous debugger and I wasn't able to get it fixed/changed. My C++ studies can finally continue.
I'm glad that my video helped you
Thank you so much this was very informative and helpful tutorial. 😊 May your channel hit millions of subscribers. 😊🙏
Thank you
Thank you VERY MUCH for this tutorial! Everything worked perfectly. Now, I'm going to follow your vid on integrating Visual Studio Code. Really well done, man!
Glad it helped!
Thank you for the tutorial. It went well and I can now start programming in C++. Much thanks
Glad it helped!
thankyou so much for making this video and helping me to solve the GCC problem..
The best tutorial for installing G++ & GDB. You deserve the best explaining award, man! Thanks a lot:)
You're welcome!
Thanks for the tutorial! Heads up for windows 8 users, the path environment variable is displayed within a single 'value' field and you just have to paste in the path on the end separating it with a ';' from the others.
Thank you for posting
This will help many :)
@@LearningLad happy to contribute in any way I can!
Super helpful! Im not a super techy guy but this was very easy to follow. Exactly what I was looking for.
Glad it helped!
The way you explained each and every step is next level 🔥
Thank you
Nicely explained...... You're the best, sir
Thank you
Thank you very much bro for this video it's very helpful for me 🙂
Most welcome 😊
I was able to understand and follow your steps easily! Nice explaining and a big thanks to you sir!
You are most welcome
Simply put and easy to follow, thank you.
Thank you sir... Really helpful !!
Most welcome!
You're a god between humans bro, you saved my life ! Really, really great tutorial
glad this video helped you.
but don't compare anyone to god :)
Yep, because people are real xD
Thank you thank you thank you. I thought my system was just broken cuz nothing would work but following this till the end fixed it. Thanks!
Pleasure
Excellent video, well paced and easy to follow. Thank you.
Pleasure
while(1):
print("Thank you🙏")
pleasure :)
*printf("Thank you");
@@rounakdhaugoda2921 he used python
@@LearningLad cout
Very helpful video. Super easy to follow, especially for beginners.
Please note that if you are not able to edit the "path" under "system variables", edit the "path" under "User variables for _insert name_" instead. That worked for me. Thank you again, sir!
Thank you for posting:)
@@LearningLad can you please make a tutorial on how to edit the path?
@@LearningLad It is showing 'bash: gcc: command not found' though I followed the exact same procedure as you
helpful, thx
This also worked for me! To provide a little clarification because it took me a second, go to Environment Variables just as instructed in the video. Instead of clcking on "Path" under System variables at the bottom, look at the top in the area labeled "User variables for [insert name]". From there, click on the "Path" option and copy in the same thing the video instructs (or just make a new variable with that path as the value)
A very nicely layed out tutorial. Thank you so much!
You're very welcome!
Super helpful!!!
Thanks, Mr. Anil!
welcome :)
fastest sub i've ever given to a channel
thank you :)
Me too👀❤
best one
Thank you :)
Thanks a lot for this tutorial, Helped me so much!
Thank you bro! Instructions were so clear.
You're welcome!
I'm having trouble in the checking version step. I am getting an error like:
-bash: gcc: command not found
Any help?
me as well
Thank you so much, sir... I was really very worried when I saw that the official site of MinGW was not working. But I got you..who explained each and every detail so nicely as to how we can install MinGW without their official site. THANK YOUU SO MUCH SIR...you saved me. And most important thing is that you updated your previous video of the installation of MinGW. 😊😊😊
You are most welcome
One Of The Easiest Installation Method And You Explained Very Nicely.
Thank you so much! This was very straightforward and saved me so much time given that I'm new to programming
You're very welcome!
at the end of the installation on terminal this is my error: failed to synchronize all databases (unable to lock database)
whyy??
on the very last part when checking if gcc --version is on the cmd i did the steps and it stills prompts out:'gcc' is not recognized as an internal or external command,
operable program or batch file.
If gcc is installed properly then make sure that you have set the path environment variable properly
And how to do that...
I am also stuck at gcc: command not found
happened to me too, I just re install them again and it works
My path file was wrong and when I corrected it the problem was solved.
@@sushovitshah9083 how can I set the path?
thank you for uploading such a descriptive video.
It's my pleasure
I did exactly the same steps as done in the video but, at 11:50 when there was a command "gcc --version" used, it gave me an error, i.e., "bash: gcc: command not found", now what should I do to execute it successfully?
use the command pacman -Syy first and then continue using pacman-Su
same experience. How can it be fixed? Thank you.
same for me
@@sahibsingh1855 it is not working what to do
I had the same problem but rewatched the segment to find out that this task and the further tasks following are performed in mys2 mingw 64 bit and not in mys2 mingw ucrt-64 bit ...(make sure the terminal which opens have the blue icon and not aneon one if you didn't get the above)..
Sir, after installing this we will also have to install VS code for programing in C++ ?
You can use any text editor / ide
Thanks Sir
Worked like charm!!! no errors at all, Thank you very much!! :)
My Pleasure :)
You have been a great help. Every step of the video worked. Very clear instructions and easy to follow. Thank you so much ! I can finally start practicing C 😁
You're welcome!
Sir I am unable to perform gcc --version and g++ --version.
What should I do?
how do u rectify the issue can u please tell
Repeat the same command you typed before,
"pacman -S mingw-w64-x86_64-gcc" For 64 bit OR
"pacman -S mingw-w64-i686-gcc" For 32 bit,
until there is nothing more to install (Stop when it shows "Net Upgrade Size: 0.00 MiB")
Then resume the tutorial.
@@ullasgrevi should i click yes, because this is the second time and doing this yet gcc is not still working :(
hey! this tutorial is really helpful but im having one problem, when entering gdb --version it is showing an error of not recognizing 'gdb' as an external or internal command, could you please help?
I have the same issue maybe there was an update that changed how you install gdb
Edit: tried "pacman -S gdb" and it seemed to work
thanks for posting :)
I couldn't get gdp
This was immensely useful. Thank you mate!
Glad it helped!
this is one of the best tutorials I have ever followed.
Thank you 🙏
hello sir. When I try to view the version of gcc after editing the path its again shows the msg that "gcc is not recognized as a internal or external command..". what will i do?
Close command prompt and reopen it
If gcc is installed properly then check the path environment variable.
@@LearningLad Thankuu sir now its done.
@@LearningLad thanks you are the best
Pleasure
Keep learning :)
@@LearningLad for gdb showing command not found
bash: gcc command not found 11:45 sir plz help me
thanks so much for, thats the only video that solved my problem i've been searching the whole day
You are welcome!
Thank you so much man I watched 5 videos to try and find an answer to my problem and you covered this so well that doing every step of your walkthrough solved everything. Seriously I can not thank you enough
Glad my video helped you:)
Setting the new path doesn't change anything. The cms give the same message gcc is not recognized as a command. Visual studio does the same when I try to run code.
yea exactly, idk what to do now
at $ gdb --version
th terminal says -bash: gdb: command not found
what can i do