Thanks Vs code and Mr Tarik for making my life easier. I was trying to configure the compiler from past 2 days. But finally have configured it now. Thank you once more.
Thank you thank you so much I have been trying to set up vs code since 3 days and almost tried 20 times with various methods but couldn't. But after watching your video I solved the problem in first trying.
Thank you vs code ; the only video on yt , that solved the problem . the part at 2:45 solved the issue that was causing hinderance in the output, thanks once again .
The "Option of C/C++ :Select IntelliSense Configuration" and C related options although I have followed the steps you mentioned thoroughly.Can you please tell me any alteration or alternative step for Verification of Compiler Installation ?
If you are not seeing the compiler in the drop-down from the command, it is likely that you need to revisit the steps to correctly set your path environment variable. Make sure it is pointing to the proper “bin” folder
@@tarik_hello hey i have a doubt, i am putting the compiler in my local disk D drive for space management, and i put the path there, i also put the folder for vscode as if my project folder there but it isnt working? any help
@@ZeusDaBoy This is most likely not an issue with our extension but rather VS Code. If VS Code and your files do not reside on the same drive you will not be able to access your files. I would suggest you store compilers on your C Drive
try revisiting those steps dude, mine mistake was, i edited the path without choosing the account, so go on search and type edit variable for your account then follow those steps told in video on how to edit path variable, worked for me tbh
Not able to find the selections what you showed on for 'Edit Environment selection' .. I am already using VsCode for Python.. Do I need to change anything else?
This sounds like a compilation issue and not an issue with compiler installation. Could you provide more context like the full error message and type of project you are building?
Same issue...when i try to run the code it says " The prelaunch Task 'C/C++:gcc.exe build active file' terminated with code -1. And the options to choose are "debug anyway" , "show errors" and "abort" .
Excellent!!! Do a video in creating a software start to finish but not half ass and do show everything that's needed from setting up the coding software to creating a UI and show how they all talk to each other
Good idea - a good starting point for you might be our Getting Started with C++ video (ua-cam.com/video/qeEcV6u1kV4/v-deo.html), which explains how to set up the environment, install a compiler, and then you run and debug a piece of code. Otherwise, we are always looking for more video ideas that would be helpful to you!
I actually loved your video very specific to the point. You are awesome at explaining things, thank you! I had to follow you on instagram & subscribed to your YT!
Sir I am facing a problem in the command prompt, after I type gcc --version it says 'gcc' is not recognized as an internal or external command, operable program or batch file.
i have a question its not always compiling using the gcc i should always change it in the C/C++: Select IntelliSense Configuration... recently used G} how can i make it a defualt compiler @@tarik_hello
This is likely due to a couple of things: 1. You need to have a .cpp file open to access the extension commands 2. You need to be acting within a workspace folder and not in single file mode
Could you please explain more about your situation? If your VS Code instance cannot locate the compiler you may need to revisit the environment variable step.
I dont have an intellisense option. How do you get your command palatte to say search and have a magnifying glass? I just installed vs studio and it says unentitled workspace.
Make sure you have a folder open with the files you want to work with. You can do this by using “Open Folder” under the file menu. To use the command pallete, use the ctrl+Shift+P hot key. To get access to the command from the video you must have an active .cpp file open
Did everything you said in the video trying to get C working with the compiler in visual code. Keep getting in command prompt gcc is not recognized as an internal or external command, operable program or batch file. How do I fix this??? Got in the right path etc.
@@wasdaq2293 OMG you are life saver. Had the same issue and no matter what i did my command prompt did not recognise but after running it as an administrator it works
I'm having issues running C++ code that uses LAPACK? Should I download necessary LAPACK libraries/packages from MSYS2 and then save the corresponding .dll files in the same directory as the 'path variable' (i.e., the same directory as the compiler)?
While I am unfamiliar with LAPACK, the tutorial specifically mentions how to setup a compiler from MinGW. If the compiler you are trying to setup is not well known, you may need to have the extension detect it manually using the “Select IntelliSense Configuration” command as VS Code may not recognize it as a valid compiler. Could you please provide more information about LAPACK?
thanks for explanation i checked the steps several times but i have a small problem i cant find " select intellisense configuration.." in command palette ? what's the problem ? (gcc ,g++ and gdb have been installed correctly according to cmd bcz i can find their version and related info)
Hey there I followed the guide exactly as you state but when I go to run coding, I get this error code. The preLaunchTask 'C/C+ +:gcc.exe build active file' terminated with exit code -1. Environmental Variable is also set up to C:\msys64\ucrt64\bin. When I run the cmmd prompt g++ --version I get no error codes either. Any ideas what could be going on ?
@@tarik_hello Thanks for responding, I was able to set up the compiler and run code without issues. One thing I have to ask is why nothing is showing up in the Output when i run code? It only shows up under the terminal when I run my code. I remember before when I would run a file it would run it in Output but now its in terminal. Is this normal? How can I fix it? Edit: I am dumb I had C/C++ when running the code instead of just running the code, also unchecked run in terminal, and installed Code Runner extension.
hello I download and follow all instructions but when I want to see if there is some memory leak by using -fsanitize=address it didn't work and it say "It cannot be find" so is there an other command or something else to resolve my problem? thanks
I have a problem sir, i used to execute program that using mathematic function. And the program error -1. But the other program still working, how do i fix it?
there are two places where you are able to add PATH. firstly that is shown in the video, 1:57 , User variables for [user] , below that , System Variables is given. In that system variables, PATH is also mentioned. You have to add the PATH there also similar to the process mentioned for above "User variables for [user]".
I got to the last step and the Use gcc.exe option appears after running Select IntelliSense Configuration but when I run the code is says: “file format not recognized; treating as linker script”. I double checked the path and it has the correct bin file.
This sounds like a configuration issue, please take a look at our documentation page or video about running your C++ code. This video is just for getting your compiler
my command prompt isnt picking up gcc and says " ' gcc' is not recognized as an internal or external command, operable or batch file." how do i fix this?
hey i figured it out! it could be that you selected the msys64's "bin" instead of the ucrt64's "bin" in the edit environment areas section. Hope this helps!
@@Febbe1That is a great question! While there are many compilers to choose from, MinGW tends to be the most widely used and thus the subject of this tutorial.
So frustrating, none of this works. I follow the steps to the letter, but after the pathing step, nothing is pathed correctly. using the gcc --version command in command prompt shows that msys2 isn't being used at all, and it results in the compiler being inactive no matter what I do
@@tarik_hello I have the same problem and I am pointed to that bin folder. You keep giving the same answer to people with the same problem that doesn't help.
Thanks Vs code and Mr Tarik for making my life easier. I was trying to configure the compiler from past 2 days. But finally have configured it now. Thank you once more.
No unnecessery talk and straight to the point.....Thank you!!
For newbies, this is the "only video you need to kick start your journey"😁
thats not wot ur mom said
as a "newbie" i confirm this
This made my life easier! And everyone who's reading this "Please don't install MinGW by Source Forge, its trash!" (at least for me. it didn't work)
I loved the "after you have installed the installer.."
i like "click ok, and click ok, and click ok" 2:17
@@RanMC9918 "okay?"
Awesome.. concise, with all the info needed to get started. All instructional videos should be like this :)
This video was very clear and easy to follow. Excellent.
I Was Struggling To Download MinGW And This Video Has Save My Time !!
Thank you thank you so much
I have been trying to set up vs code since 3 days and almost tried 20 times with various methods but couldn't.
But after watching your video I solved the problem in first trying.
Great to hear!
@@code make vs code more fast
Thank you so much man. This video was incredibly helpful. Its a relief to able to use VS for C
Thank you so much man. This video was incredibly helpful
Thank you vs code ;
the only video on yt , that solved the problem .
the part at 2:45 solved the issue that was causing hinderance in the output,
thanks once again .
The "Option of C/C++ :Select IntelliSense Configuration" and C related options although I have followed the steps you mentioned thoroughly.Can you please tell me any alteration or alternative step for Verification of Compiler Installation ?
If you are not seeing the compiler in the drop-down from the command, it is likely that you need to revisit the steps to correctly set your path environment variable. Make sure it is pointing to the proper “bin” folder
Try checking if you are in a Trusted window or in restricted mode, this works only in trusted window.
@@tarik_hello hey i have a doubt, i am putting the compiler in my local disk D drive for space management, and i put the path there, i also put the folder for vscode as if my project folder there but it isnt working? any help
@@ZeusDaBoy This is most likely not an issue with our extension but rather VS Code. If VS Code and your files do not reside on the same drive you will not be able to access your files. I would suggest you store compilers on your C Drive
try revisiting those steps dude, mine mistake was, i edited the path without choosing the account, so go on search and type edit variable for your account then follow those steps told in video on how to edit path variable, worked for me tbh
Thank you so much! I watched a few videos on this and none of them worked.
This video was very easy to follow, and it worked perfectly! ❤
Thank you so much, after being stuck with this for 5 hours and 69420 errors the installer gave me, I can't express how grateful I am to this tutorial
Glad this video could help you out!
Thanks a lot Mr. Tarik and the VS Code community! This video helped a lot.😃
This is a miracle, a video that you can find all info doing in real time
Not able to find the selections what you showed on for 'Edit Environment selection' .. I am already using VsCode for Python.. Do I need to change anything else?
Search edit environment in search bar... you'll get it
Bro did you find you problem solution? can you share it with me I am facing same problem..
Thank you all SO much! I needed this!
Thank you for watching!
Your video has made it easier to start with vscode. Thank you so much man.
No problem! Glad you found it helpful!
@@code what about the people facing difficulties
At 2:24 in the command prompt it shows that (gcc is not recognized as an internal or external command ) , what should I Do now ?
Please revisit the environment variable steps and if that doesn’t work try installing the compiler again
If anyone still has a problem with this one, make sure you choose "Edit environment variables for your ACCOUNT", not system.
@@pumpkin1409 where is that one please ?
@AhmedAbdullah-qf8ou same here
Anyone got this one right as I'm getting the same problem 😅
Thank you for making this simple and straight forward
Here is the command for installing MinGW in MSYS2 for anyone who missed it: pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
Can't copy😢
@@omnii630 that's right bro, you need to select whole command and slip it to directly that position. you cannot paste there.
it doesn't work, it says the pacman command does not exist.
@@moist5339try running this command before that one -> “pacman -Syu”
It worked for me
Yes what should we do now@moist5339
I had been stuck on it for 2 years, finally landed on this video and my problem is solved. Damn!
Thanks a lot!!
this video was helpful in many ways😅😅💯
were you able to install gcc successfully?
I am having a lot of trouble
Glad this video could help you out!
After I did this no matter what I did it showed "The preLaunchTask 'C/C++: g++.exe build active file' terminated with exit code -1", what do I do?
This sounds like a compilation issue and not an issue with compiler installation. Could you provide more context like the full error message and type of project you are building?
Same issue...when i try to run the code it says " The prelaunch Task 'C/C++:gcc.exe build active file' terminated with code -1.
And the options to choose are "debug anyway" , "show errors" and "abort" .
@@tarik_hello That is the full error message. And I doubt it is the projects fault. I made a hello world project and got the same problem
I have the same problem, did you find the solution mby?
@@nejcjamsek9806 make sure that if you are running a c++ file, you are using the g++ compiler, not gcc
Thank you mannhhh... Now let me make some programs and projects😉
Glad it helped! Be sure to like and subscribe!
Thank you very much, just downloaded my very first step in coding
This video save my life, thx u so much.
I’m glad it helped! Be sure to like and subscribe!
Excellent!!!
Do a video in creating a software start to finish but not half ass and do show everything that's needed from setting up the coding software to creating a UI and show how they all talk to each other
Good idea - a good starting point for you might be our Getting Started with C++ video (ua-cam.com/video/qeEcV6u1kV4/v-deo.html), which explains how to set up the environment, install a compiler, and then you run and debug a piece of code. Otherwise, we are always looking for more video ideas that would be helpful to you!
Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Glad it helped!
this helped me in a sticky situation. thanks man
Glad it helped you!
Thank you so much for the helpful guide!
Thanks for the instructions👍
Awesome instructions! Thanks! // Newcomeer to C/C++
I actually loved your video very specific to the point. You are awesome at explaining things, thank you!
I had to follow you on instagram & subscribed to your YT!
Thanks, this helped a lot!
Thanks for the amazing tutorial! It works for C too :)
Thank you Tarik, this was helpful.
thank you so much for the support
it's showing pacman-S--needed command not found . what to do?
pacman -S mingw-w64-ucrt-x86_64-gcc
Thank you so much, this saved my life
great tutorial...way to go for mingw c++ coding...thank you...
Thank you so much, finally working
thank you you really made this easier for me
Sir I am facing a problem in the command prompt, after I type gcc --version it says 'gcc' is not recognized as an internal or external command,
operable program or batch file.
im having problems too lol :( was supposed to be easy...
Could you try revisiting the PATH environment variable step? Make sure you are pointing toward the bin folder.
@@tarik_hello I have done that and still doesn't show up. I have it directed towards the BIN folder.
check the folder "bin" . if it's empty running the code pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain in installer can help
Mine says the compiler is there, but visual studio won't compile the code.
Hey! I followed all the steps exactly shown here and everything was fine until the last step where I couldn't find this step @2:50... Please help
Please make sure you have the extension installed and you are looking at an active .cpp file
Do I need to Edit the "Path" of the System variables as well? 1:55
Only the Path environment variable. Make sure you select the bin folder of the correct compiler as the path.
inally i was able to this by my self thank u blud
Glad it helped 👌🏿
i have a question its not always compiling using the gcc i should always change it in the C/C++: Select IntelliSense Configuration...
recently used G} how can i make it a defualt compiler
@@tarik_hello
Dunno how but i managed to turn a 3:07 minutes video into a 20 minutes task. wish me luck guys, trying to learn by myself
You got this!
You got this champ
Wish me luck too ❤
worked well, make sure to let the command prompt download all dependencies
i click three time and then start but easy and very straigt forward. thanks one again
The "Option of C/C++ :Select IntelliSense Configuration" is not shown in the drop down.pls help
This is likely due to a couple of things:
1. You need to have a .cpp file open to access the extension commands
2. You need to be acting within a workspace folder and not in single file mode
type > for it to show up
@@abdurrahmanalyajouri7992 Thank you
Thanks it worked and was easy to set up
Thank you very much for this video!
You're very welcome!
after giving the command , it is not prompting.
In this case , what should i do ...please tell me
Could you please explain more about your situation? If your VS Code instance cannot locate the compiler you may need to revisit the environment variable step.
Top video. Thank you!
What a Beautiful Explanation
Glad it helped!
It failed to retrieve certain files while installing the MySYS
Please revisit the installation, you may need to re-run with admin privileges
@@tarik_hello i installed it but now vs code crashes everytime I use a .cpp extension for any file
Thank you very much. Very helpful!
Helpful. Thanks for sharing!
Thanks for watching!
Thank you it was very useful
2:20 gcc --version still not working even after doing all of the steps
Yeah even mine
me too, i tried 10 times up till now and finally work :v
sir,i followed all your steps but when i used command > for checking if i had the compiler so i didnt find it (no things showed)
same here if you found the solution please help me too
This is probably due to the compiler not being correctly set in your path environment variable, could you try revisiting that step?
underrated video!
I am glad the video helped! Feel free to like and subscribe as well!
I dont have an intellisense option.
How do you get your command palatte to say search and have a magnifying glass?
I just installed vs studio and it says unentitled workspace.
Make sure you have a folder open with the files you want to work with. You can do this by using “Open Folder” under the file menu. To use the command pallete, use the ctrl+Shift+P hot key. To get access to the command from the video you must have an active .cpp file open
@@tarik_hello It turned out I didn't have a cpp properties or something folder so I made it by hand then it worked
Did everything you said in the video trying to get C working with the compiler in visual code. Keep getting in command prompt
gcc is not recognized as an internal or external command,
operable program or batch file. How do I fix this??? Got in the right path etc.
If you havent, try running the command prompt as an administrator.
@@wasdaq2293 OMG you are life saver. Had the same issue and no matter what i did my command prompt did not recognise but after running it as an administrator it works
check the folder "bin". if it's empty - try to run the command pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain in installer again
Thanks I was having trouble setting it up
I am glad the video helped you out! Be sure to like and subscribe!
i followed every single step, but my bin folder is empty 😣😣😫 why?????????????? ans please.
@@am99.99 Open it again, define the path variable and click ok, this should apply the settings.
@zeebicse9426 I'll try,thx for response
@zeebicse9426 I tried another way but still.....bro done. Thank you 🤝
I'm having issues running C++ code that uses LAPACK? Should I download necessary LAPACK libraries/packages from MSYS2 and then save the corresponding .dll files in the same directory as the 'path variable' (i.e., the same directory as the compiler)?
While I am unfamiliar with LAPACK, the tutorial specifically mentions how to setup a compiler from MinGW. If the compiler you are trying to setup is not well known, you may need to have the extension detect it manually using the “Select IntelliSense Configuration” command as VS Code may not recognize it as a valid compiler. Could you please provide more information about LAPACK?
perfect now i can start my journey of hard coding in cpp
01:32 error: invalid option: '--clean' and '--sysupgrade' may not be used together
Thank you very much!)
Thanks for watching! Be sure to like and subscribe!
What should i di if i can not open edit environment variables for your account in windows search bar?
thanks for explanation
i checked the steps several times but i have a small problem
i cant find " select intellisense configuration.." in command palette ?
what's the problem ?
(gcc ,g++ and gdb have been installed correctly according to cmd bcz i can find their version and related info)
Why does it stop at , running post transaction hooks
Updating the info directory file......
THANK YOU SO MUCH❤❤❤❤
1:27 there shouldnt be a space like in the video between -w64 -ucrt
Hey there I followed the guide exactly as you state but when I go to run coding, I get this error code. The preLaunchTask 'C/C+ +:gcc.exe build active file' terminated with exit code -1. Environmental Variable is also set up to C:\msys64\ucrt64\bin. When I run the cmmd prompt g++ --version I get no error codes either. Any ideas what could be going on ?
It sounds like you are using the gcc compiler to run C++ code. You want to use the g++ computer instead. The gcc compiler is for c code
@@tarik_hello Thanks for responding, I was able to set up the compiler and run code without issues. One thing I have to ask is why nothing is showing up in the Output when i run code? It only shows up under the terminal when I run my code. I remember before when I would run a file it would run it in Output but now its in terminal. Is this normal? How can I fix it?
Edit: I am dumb I had C/C++ when running the code instead of just running the code, also unchecked run in terminal, and installed Code Runner extension.
@@JDJHB117 I am glad you were able to fix your issue!
hello I download and follow all instructions but when I want to see if there is some memory leak by using -fsanitize=address it didn't work and it say "It cannot be find" so is there an other command or something else to resolve my problem? thanks
I would advise you to look into the description of this video and explain your issue in detail to the team's issue submission page.
thank you Tarik, but can you help me why my mingw-w64 for windows is not working for me
after this "-S --needed base-devel mingw-w64-ucrt-x86_64-toolchain" I have a "-bash: -S: command not found" what should i do&
pacman -S mingw-w64-ucrt-x86_64-gcc
@@873carol thanks bro
At 1:45 it did not close auto matically so i just closed it and in the cmd tab it says it did not recognized
I have a problem sir, i used to execute program that using mathematic function. And the program error -1. But the other program still working, how do i fix it?
my version is 6.3.0 is that a good thing or I should update it. If I should, how do I do that?
Awesome but little bit confusing for newbies.. it looks like you skipped some parts ... plz make sure you can explain each step clearly
finally someone who isnt a pajjet scammer indian
Thank you!!
it worked for a day or two then it keeps saying error with the file not existing
Could you provide more context? Are you not able to open a .cpp file?
Exactly same bro😢😢😢😢
I can't get the last step to work like the video does, although I've been able to compile and execute via shell. What should I do....
reset vscode json!!!
Did he click 'bin' INSIDE ucrt64? Or click ucrt64 like he said in the video? He says and shows two different things....
Thanks for helping 😊
'gcc' is not recognized as an internal or external command,
operable program or batch file.
i don't what should i do
2:32
help me guys
Please revisit the step where you set your PATH environment variable
there are two places where you are able to add PATH. firstly that is shown in the video, 1:57 , User variables for [user] , below that , System Variables is given. In that system variables, PATH is also mentioned. You have to add the PATH there also similar to the process mentioned for above "User variables for [user]".
I got to the last step and the Use gcc.exe option appears after running Select IntelliSense Configuration but when I run the code is says: “file format not recognized; treating as linker script”. I double checked the path and it has the correct bin file.
This sounds like a configuration issue, please take a look at our documentation page or video about running your C++ code. This video is just for getting your compiler
After pressing 'y' (5/58) files downloaded but then error occured (problem: unable to get local issuer certificate)
I believe this is a permission issue, try re-running the compiler with admin privileges.
Too many mgw icons in start menu 🫨
@@tarik_hellostill the same error😢
thanks very helpful very powerful
I did every step clearfully but it still its showing gcc is not recognised as an internal or external command. Need help
my command prompt isnt picking up gcc and says " ' gcc' is not recognized as an internal or external command, operable or batch file."
how do i fix this?
hi this also happened to me, have you figured out the solution?
hey i figured it out! it could be that you selected the msys64's "bin" instead of the ucrt64's "bin" in the edit environment areas section. Hope this helps!
@@smurfij4212Thank you for your suggestion! I would second this advice
@@smurfij4212 thank you so much! im pretty sure this was my issue :)
Thanks, VsCode!!!
One question, why not use wsl?
This tutorial is specifically for Windows users who requested a MinGW tutorial but you bring up a good idea for a future tutorial. Thank you!
Actually the question ist, why not use MSVC or clang-cl? Both are way better integrated into the system without extra layers between them?
@@Febbe1That is a great question! While there are many compilers to choose from, MinGW tends to be the most widely used and thus the subject of this tutorial.
So frustrating, none of this works. I follow the steps to the letter, but after the pathing step, nothing is pathed correctly. using the gcc --version command in command prompt shows that msys2 isn't being used at all, and it results in the compiler being inactive no matter what I do
Please make sure you are pointing toward the bin folder specifically; this is an issue a lot of people are running into.
@@tarik_hello I have the same problem and I am pointed to that bin folder. You keep giving the same answer to people with the same problem that doesn't help.
make sure you edit the Path in "System variables" at the bottom too
@@tibetje226 make sure the folder "bin" is not empty. mine was empty and after fixing it everything worked out.