HomeЛюди и блогиRelated VideosMore From: modify0123

How To install MinGW (GCC) in Windows

1810 ratings | 199184 views
MinGW is a port of the GCC to be used in Windows. Instructions: 1.Go to http://mingw.org/ and click download installer 2. Execute the .exe file you downloaded from source forge and click continue. 3. Select both msys packages as well as the basic install. Additional Packages are optional. 4. Install the packages by going to the install menu and clicking "apply changes" 5-8. Wait so long it takes four steps. 9.Run the command 'setx PATH "%PATH%;C:\MinGW\bin;"' This command will add the compiler applications to the PATH(Windows searches the PATH for one line execution commands eg. "dir" "cd" are all located on the PATH.) We need to add these to the PATH so compilation can be done in one line. Whatever step this is. example compile command is: "gcc helloWorld.c -o helloWorld.exe" I will break that command down for you. gcc is the compiler for c, helloWorld.c is a file to be compiled, -o is an option for this command that specifies the output file to the second argument given, the last argument is the output file.
Html code for embedding videos on your blog
Text Comments (254)
Roseki (3 years ago)
In windows 10 is : setx MYPATH "%MYPATH%;C\MinGW\bin"
Dharmang (1 year ago)
or u can just copy gcc file path to env variables
Iam SRK (1 year ago)
vince94 u need to check the path bro
Legend27 (1 year ago)
I need help at minute 6
NameGoesHere (1 year ago)
this guy forgot colon between C and \
vince94 (2 years ago)
I ended up giving up and using the repo on https://nuwen.net/mingw.html instead, someone recommended it to me
fusiondew (2 months ago)
Much appreciated!!! I got it working finally, thanks!
Cam (6 months ago)
you're my god now
Maz (7 months ago)
"You can count with me if you want" Why this sounds so depressing? Lol
MaximilienL (7 months ago)
Lucas (8 months ago)
You saved me, thank u!
Microprod (8 months ago)
my error is : collect2.exe: error: Id returned 1 exit status Any help? Im learning C++. first i entered hello.cpp -o hello.exe then that error came out then i changed its name to hello.c then the error is now "hello.c:1:20: fatal error: iostream: No such file or directory #include <iostream> compilation terminated."
modify0123 (8 months ago)
This error is because of the linker in C++. ld is a command that loads libraries for your executable. In C++ you input output is a stream and all the streams such as cout and cin are in iostream. You can include that using "#include <iostream>". In C the basic input output is kept in the stdio.h header. You can use "#include <stdio.h>" instead. The basic functions for input output are scanf and printf. For learning purposes that will be enough. Farther down the road there are some things you'll want to avoid with printf and scanf.
Tanmay Sane (9 months ago)
Go Head watch someone else's video..omg..its was hilarious! You nailed it man!
BUNTRON (10 months ago)
Spent the whole morning trying to get this to work. Turns out, C:\MinGW\bim doesn't work. Who'd have known...
Daniel Derevinsky (10 months ago)
de best ) thanks
Shashank Rawat (11 months ago)
thanks, brother
Tanuj Chakraborty (1 year ago)
Thank you so so much! Only video that actually helped me. Thanks again!
Ayush Agarwal (1 year ago)
Thanks a lot!!!
Russell Molimock (1 year ago)
Thanks for the video! For anyone who might think cmd prompt is returning a BLANK LINE at the end (as I did), don't forget to actually run the .exe file after. LOL I thought I missed that at the end of the video first time around. I just ran the: "gcc helloworld.c -o helloworld.exe" and expected it to execute afterwards on it's own. Nope. Type in: "helloworld.exe" and hit enter to actually run it.
guest_sshd _js (1 year ago)
Cool simple video' cheers
Softech Programming (1 year ago)
Are you using windows 10? Don't have the idea to set path. Go to this, and find more interesting... #SofectProgramming
Maju Piju (1 year ago)
show some love and like the bottom ;D
Legend27 (1 year ago)
Minute 6 dont work.
Jordan River (1 year ago)
Thank you so much bro
FurrehSus fuck (1 year ago)
THIS IS POSIBLE WORM! DONT DOWNLOAD! this page is dangerous
MotigEx (1 year ago)
thanks mate
Elijah Boyette (1 year ago)
Great useful video 👍🏼
Elijah Boyette (1 year ago)
It is a little bit easier to go to environmental variables to add the path though,
Ranmitita (1 year ago)
Thanks this helped a lot!
HAZEL WANG (1 year ago)
Hey, could you please tell me why I got "Access is denied" error after I entered my set path command on my windows10?
ilyes ilyas (1 year ago)
i need your email if you could!!
SLIM HAMDI (1 year ago)
Hello friends, the installer shows error message " download failed " in the step before the selection of packages!
David Hasbun (1 year ago)
Thank you! You were the only easy to follow video instruction I could find.
vivek viv (1 year ago)
Awesome video sir it was helpful
Thank you @modify0123
Ankit Ardeshana (1 year ago)
how to update gcc to 7.2
Ilham Kurnia (1 year ago)
thank you so much, it's very helpful even if it's uploaded 3 years ago :D
Miles Falk (1 year ago)
Thanks so much :) This really helped me out!
PTC man (1 year ago)
i want too much install mingw, but the installer have vírus according virustotal. Isn´t have an alternative to install mingw (well, "install" isn´t exactly what the program does, the mingw isn´t need to be installed, all u need to do is put a path to windows found the bin files). I´m try make manually but have A LOT of packages, and always something is missing (on my case, i want a win32 working compiler on C , but i can´t compile, always something is missing ). Do you know some alternative ?
Was windows 95 first and only one for executable files and direct desktop were there any same operating systems at that time not from Microsoft?
I boot from use my zorin os on devices which have no any os.mint becomed boring they say that it will be no more windows just smaller wind 10 updates only drivers are better on some mainbords we could make company with assebmler of make new materials for many something in beetween quant pc and non bynary 11 00 1010 and some computer that whould use 123456 and 7of or on and all numbers but we need much people much money and much new Electronics components.I whold talk about networks and badwith speed but i dont have time right now.
modify0123 (1 year ago)
The .exe file extension is and always has been unique to Microsoft. They require a specific runtime environment that only exists on windows systems. As for direct desktop there were many operating systems at the time that had direct desktop. The GNU OS and Linux kernel supported the X window system and could boot straight to a graphical interface. Redhat SUSE and slackware all existed back then, although they were not very easy to configure or user friendly.
TacklessNebula3 (1 year ago)
Thank you... it really helped me a lot!
Sai Pavan (1 year ago)
cheers pal! it helped. thank you
John Tian (1 year ago)
Helpful, thanks for sharing.
Gulim Alkenova (1 year ago)
Youssef nama (1 year ago)
thank you so much i like this channel
appropinpinquo (1 year ago)
Thanks a lot!
A. Siddique (1 year ago)
Thanks ...
Thomas Linebaugh (1 year ago)
Thanks from 2017!
Hey, so me and theskilledgutarist both followed your directions, put these messages popped up, any fixes? " setx PATH "%PATH%;C:\MinGW\bin;" "the following message appeared: WARNING: The data being saved is truncated to 1024 characters. SUCCESS: Specified value was saved.
modify0123 (1 year ago)
You're welcome from 2017!
Addicted Engineer (1 year ago)
Awesome video. you seemed to be on weed or something though :)
Deft (2 years ago)
Thank you mate, very good tutorial :)
thank you a lot! this is very meaningful to me
Eirik Kvalheim (2 years ago)
Thanks man, just what I needed :)
Anand Krishna (2 years ago)
modify0123 eda m*** arilengi vela veti poyi iri alakare moonji kan
Lucky kulon (2 years ago)
Thank you very much for this video!
andrew (2 years ago)
"DAEMON isnt my real name but I figured it would be a badass name for my computer LMAO
Fe86jvsk12 knight! (4 months ago)
hheh sounds funny
Azizi Soufiane (2 years ago)
thank you so much
Derek Tailor (2 years ago)
Thank you so much! This helped me big time!
RD (2 years ago)
(2 years ago)
Thanks. It was helpful.
Good video, simple and clear, i couldn't get my damn compiler working then i found your video.
Pablo Hernandez (2 years ago)
For those people who are having a hard time setting their path right. Do this: *Locate the bin folder using your file explorer first, then copy the address into the clipboard (CTRL+C) c'mon guys... *Then go to the console and write setx Path "%PATH%;[and paste here the address of the bin folder you copied]" *Then close and open the console and gcc should work. I had to do it this way because in the latest version (6.3.0) it installs inside the ProgramFiles folder in the C drive... Hope it helped!
shruthi k (2 years ago)
Thank u :)
Magnus Lindblom (2 years ago)
short and concise. Loved it!
Ibrahim Altaha (2 years ago)
coooooooool ,,,,,,, looking for more awesomeness
Deadly Servidor (2 years ago)
Hi, can you help me? So... I'm trying to download the setup, but the setup doesn't get package an print an error " mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download:cannot open URL mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download: download failed mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-gui.tar.xz?download:cannot open URL mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-gui.tar.xz?download: download failed " Please, help me or put your installer to download on Mediafire. Thanks.
ravy pmr (2 years ago)
thanks man!
rlndjscstmd (2 years ago)
the same language your grand pa did...
B (2 years ago)
マントラBaKsA (2 years ago)
Thank you.
redsoldier90 Catalán (2 years ago)
I tried that on 2k17 but i can install it :C
xKRUZT (2 years ago)
now i can fixed this is work!
Mosa Letswalo (2 years ago)
I have done all the steps to can go under my directory >>Documents, but when I try to execute the file i get this error: "gcc' is not recognized as an internal or external command, operable program or batch file."
Bizillion Atoms (2 years ago)
thx for using opera fello opera user
sumit banerjee (2 years ago)
Thank you very much! :)
theskilledguitarist (2 years ago)
Hey good sir, I did the exact same process you specified but after i ran: " setx PATH "%PATH%;C:\MinGW\bin;" "the following message appeared: WARNING: The data being saved is truncated to 1024 characters. SUCCESS: Specified value was saved. Should I be concerned and is there a fix?
JC Candare (7 months ago)
@Mr. Yan Lucena this worked for me on windows 7 thanks
Mr. Yan Lucena (1 year ago)
Instead of typing "gcc", after you open prompt again, try typing "\mingw\bin\gcc". It worked for me.
stoiljko (2 years ago)
But can I see the MIPS code from this?
modify0123 (2 years ago)
I thought I used it for that. I could be wrong. You could also use mingw gcc and set the target arch to mips and generate an assembly file with -S. Also if you're doing this for a class then I'd also recommend turning off compiler optimizations so that you can see the assembly with no optimized code so its easier to understand.
stoiljko (2 years ago)
I have seen MARS assembler but as far as I understood, it is used to compile MIPS code, not "convert" or translate C to MIPS?
modify0123 (2 years ago)
stoiljko not really this makes compiled binaries. you can make assembly code with the -S option. what you're looking for is MARS assembler. I used it for my computer architecture class for that very thing.
rwallace053 (2 years ago)
thank you why did it take so long to find this
Clank Warrior (2 years ago)
Awesome. Like your teaching style. Chilled and simple.
egal (2 years ago)
so much vocal fry. but thanks, this was helpful.
Matthew Svihel (2 years ago)
Helped me setup my C environment for my Operating Systems class. Thanks man!
nexplex200 (2 years ago)
Thank you
1up Mushroom (2 years ago)
I typed exactly what you put when trying to add gcc to path, but it did not work when I opened up a new cmd. I got a warning that said the path is truncated to 1024 characters. Would that have something to do with it?
+PROS (2 years ago)
Same problem but its on the desktop, i can't make the path shorter, what can i do? I tried changing PATH with MYPATH it didnt say about truncated 1024 or anything but, still gcc comand doesnt work
1up Mushroom (2 years ago)
I was able to get it to work when putting my MinGW folder in my Codeblocks directory, so I can use it via Codeblocks now. Thank you for the help!
modify0123 (2 years ago)
1up Mushroom that means your path us too long. if look over it in the control panel under your user's environment variables, you can see the whole path as a string. I'd remove things you don't have a use for and make sure that the whole path is less than 1024 chars.
sautjansurarrusinur (2 years ago)
THANK YOU. I literally searched all over the internet and this stuff isn't explained ANYWHERE. You're the best.
sflake7 (2 years ago)
thank you so much :)
Masalmeh321 (2 years ago)
Watched a lot of videos, but this is the only one that worked for me. Been struggling all day, but "make" finally worked. Thanks!
Mark M (2 years ago)
nice tutorial bubba!
Garrett Carlson (2 years ago)
This is the first tutorial I watched where I could get MinGW to work, so that's a plus. I also appreciate you explaining the different packages available. All I wanted to do was compile c, but thus far, no one has explained anything about which packages do what. They just say to download everything just in case, and I still end up with "gcc is not recognized as an external or internal..."
曜宇蔣 (2 years ago)
I had to type 'mingw32-make' instead of 'make'
modify0123 (2 years ago)
MysticRunes - Minecraft RPG that's because there are both msys-make and mingw32-make. Depends on the build system you are using.
Yarsan Hoessain (2 years ago)
Avira thinks that my compiled exe is a virus.
Minh Le (2 years ago)
Thank you so much for this video. Really helps beginner like me!
phpeutm (2 years ago)
@ 7:03 "If you didn't like this video, go watch someone else's video, I really don't care" - ha ha ha ha! Thanks sharing. Thumbs up from me.
Naitra Naitra (2 years ago)
Signed in esp to like your video, thanks for your help :)
Julian Plonski (2 years ago)
Thanks.. clear and simple
Zozan Hasan (2 years ago)
thanks aloooooooooooooooooooot i was suffering to know how 2 work on it .... thank u
Benancio Rodriguez (2 years ago)
Thanks dude!
Pranay Raju (2 years ago)
I have added the directory as a path value as you have mentioned, but still the command prompt says g++ command not found as an internal or external command. Why does it happen?
Houssem Hamila (2 years ago)
Thank you. +1
the command prompt isnt compiling and the message gcc is not recognised as an internal or external command
tsetse tse (2 years ago)
THANK YOU VERY MUCH!!!!!!!!!!!!!!!!!!!!
Hung P (2 years ago)
I love you!!! You're my life saver.
Nasri Mohamed (2 years ago)
Good stuff , thanks
DropOfDarkness (2 years ago)
I have a problem. http://prntscr.com/ce00ow I have done everything said in this video and this always has happened. I tried codeblocks and I get the same thing. Missing -lpthread. Someone please help.
M Matty (2 years ago)
hello. Everytime I write gcc helloworld.c -o helloworld.exe , I get the following "gcc is not recognized as an internal or external command, operable program or batch file. What am I doing wrong?
Lacucius (2 years ago)
Windows doesn't know what you mean with "gcc". After all it can't know all the executables on your computer. It only searches in the pathes given to it in the PATH variable. You have to add your MinGW installation path (Probably C:/MinGW/bin) to the PATH variable. You may want to google how to add to the PATH variable on your system. Alternatively you can give the whole path to the gcc.exe everytime you call it. E.g: C:/MinGW/bin/gcc helloworld.c -o helloworld.exe
Pedro RoGs (2 years ago)
I could never install it without your help... Thank you bro.
Jesus Diaz (2 years ago)
Thanks U for all. Bless
Rex LUO (2 years ago)
Nice man, that really works for me, thnx

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.