How to Set up Visual Studio Code for C and C++ Programming
In this video you will learn How to Set up Visual Studio Code for Creating and Executing C and C++ Programs.
Visual Studio Code is the widely used editor in Computer Programming field.
It is the best editor for a beginner in programming because it is simple, easy to set up and has all those features needed.
First you need to Download and Install C C++ toolset ( Compiler , linker etc ) like mingw. After that you need to install Visual Studio Code. After that you need to install a couple of extensions to run C and Cpp Programs.
Download and Install Mingw
• How to Download and In...
Download and Install Visual Studio Code
• How to Download and In...
Setup Visual Studio code for Python Programming
• How to Set up Visual ...
Visit www.LearningLad.com for more free computer programming video tutorials.
Other pages of LearningLad
/ learninglad
/ learningladofficial
/ learningladedu
Пікірлер: 3 400
the fact that this video has 1 million views shows how bad vscode is at telling the user basic functionality
@shivakumar-lv6wr
2 жыл бұрын
Absolutely!, This was super simple!
@Player-fx3vt
2 жыл бұрын
Hmmm, that getting started page with links to documentation and learning the fundamentals about it. I don't think that's telling you that stuff at all .
@ytg6663
2 жыл бұрын
Clearly You are Gey👍
@chairmanmao112
2 жыл бұрын
2.365786 million*
@nomankhan7190
2 жыл бұрын
Right.
For people who are unable to get the output, save your code with ctrl s, and then run!
@rafaelfernandez725
4 жыл бұрын
you saved me
@LearningLad
4 жыл бұрын
thank you for the comment
@user-bb6si1et1k
4 жыл бұрын
helpful
@ROSSB177
4 жыл бұрын
oh my thank you so much...i.I was going crazy
@siddharth9703
4 жыл бұрын
Yo thank you bro same here thanks very much🤩🤩🤩🤩🤩
This is a great tutorial, I was stuck on configuring VS Code for C/C++ for hours and this video was very simple and easy to follow. Thanks a lot for the simple tutorial, it really helped a lot. Everything went smooth and VS code works perfectly!
@1mol831
Жыл бұрын
Code runner doesn't work for my version, I'm just using another method instead. Even notepad is easier.
Alright, the fact that you popped immediately for a C/C++ Visual Studios tutorial after you helped me with MinGW means you get my subscription. You're, sir, are fantastic.
Man you're a life changer. You made everything 10 times easier than it was shown in VSC's C++ installation guide.
@LearningLad
4 жыл бұрын
glad that my video helped you :)
@eyeofthepyramid2596
4 жыл бұрын
@@LearningLad it shows me error: ld returned 1 exit status
@williammatiz9745
3 жыл бұрын
@@eyeofthepyramid2596 I don't know if you have figured it out yet but just in case, you need to save it before you run the program. Couple of ways to do it, but the easiest way is control + s. I got the same message you did and did the save thing, works well. I hope this helps!
@ArshdeepSingh-ix3bg
3 жыл бұрын
@@LearningLad th cc++ extension is not working ,please help
@Alpha-uw6wn
3 жыл бұрын
Sir where u live in India?
you're a life saver it was driving me crazy (didn't know how to run the code so it accepts input)
You have been a great help. Very clear instructions and easy to follow. Thank you so much ! I can finally start practicing C 😁
Thank you!!! I'm just starting to code in c++ and my professor couldn't explain it as easily as you just did!!
@LearningLad
2 жыл бұрын
You're very welcome!
This was unbelievably easy and it worked perfectly fine! I was breaking my head for two hours until i came across your video(s). Thank you so much for these tutorials.
@LearningLad
3 жыл бұрын
You're welcome!
@aqtedarkazim9678
Жыл бұрын
shia
Thank you so much for this video!! Was having a hard time finding out how to put inputs into my code and you saved me :)
@LearningLad
3 жыл бұрын
You are welcome!
THANK YOU SO MUCH, I WAS HAVING DIFFICULTY WITH THE INSTALLATION, AND YOU HAVE CLEARED ALL MY DOUBTS. AND NOW I'VE SUCCESFULLY CREATED MY FIRST CODE, ♥
@LearningLad
2 жыл бұрын
Awesome Keep learning
This video saves tons of time! I had been struggling with compiling and running C in vscode for hours, and then I found this video. It's so helpful, straightforward. Thank you so much!
@LearningLad
6 ай бұрын
Most welcome
Really helpful sir. I saw atlest 10 tutorials but none of them worked. Your tutorial series worked for me. Life saver!! I hope this channel crosses 1M subscriber soon. Such an underrated channel.
@LearningLad
3 жыл бұрын
Glad it helped
Thank you so much for your help. I really liked the way you explained each step! Now I can execute C program on VS code, looking forward to some more amazing content.
@LearningLad
3 жыл бұрын
Glad this video helped you. Will make more content :)
Man I would have never gotten this without you! Professor didn't want to teach us how to setup VS Code. THANKS!
@LearningLad
Жыл бұрын
glad my video helped you :)
Dude fucken finally I missed a whole class trying to follow someone else and with you it was smooth as butter, thanks man
@LearningLad
2 жыл бұрын
Pleasure
@wotizit
2 жыл бұрын
nws
@kshau_
2 жыл бұрын
Don't curse.
@blubbermammoth8426
2 жыл бұрын
@@kshau_ I don't think the internet is the place for you then mate.
@kshau_
2 жыл бұрын
@@blubbermammoth8426 Shut up.
Excellent videos. I followed every step that you have explained for C CPP and Python and its working. I had tried this many times but never worked. Thank you very much!
@LearningLad
3 жыл бұрын
my pleasure :)
Excellent help for beginners. As a suggestion you could also show where you can find the executable produced and how you can run it from anywhere. Even on a computer with nothing installed. Some people have hard time seeing the difference between interpreters like Java or python which both need some runtime environment to run the program in, vs the direct machine code running directly on OS.
@azhagurajaallinall126
2 жыл бұрын
Could you eelaborate this further,like how to run any code in any machine? Thanks in advance 😃 09.08.2022 7:17 pm ist
Thanks Man, Even after a year this video is helping a lot of people! Great Work, Keep up with it 🔥🔥
I was struggling to configure C/C++ with VS code for hours. thank you for making it so easy! :)
@LearningLad
Жыл бұрын
welcome :)
thank you so much for the Run in Terminal, i don't even know that earlier!!!
@LearningLad
3 жыл бұрын
Welcome!
Thank you so much for this! In comparison to your video, other installation guides are just useless. Great work 💯
@LearningLad
3 жыл бұрын
You're welcome!
Thank you LearningLad for making this way quicker and easier than anything else I found! Just as a heads up in case anyone else runs into this: When I first got everything set up and tried to run the Hello World example, it threw this error: undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status All I had to do was save the file first by going File > Save and then it worked just fine.
@LearningLad
2 жыл бұрын
most welcome :)
@Oskar-zt9dc
2 жыл бұрын
Actually, it will be easier if you activate autosave
@LoradLP
2 жыл бұрын
Thank you, that saved me from like 15 min of googling probably :)
@daisy6672
10 ай бұрын
Thanku so much
@synth-_-5093
5 ай бұрын
Thank you so much I thought I did something wrong was gonna watch all the vids back lol
Thanks a lot sir....I was very much frustrated since yesterday because vs code just wasn't getting set up. I even watched code with Harry,Apna college tutorials for vs code set up. Now I watched all your 3 tutorials and it worked for me. Thanks a lot sir.From now onwards I will regularly check out this channel..
@LearningLad
3 жыл бұрын
Thank you Keep learning
this was great. fast and painless. Thank you so much!
@LearningLad
3 жыл бұрын
You're welcome!
Hey man. Thanks alot for this video. Very much appreciated, now that I lost my job to covid I can finally catch up and learn c++ and its all thanks to your help
@LearningLad
3 жыл бұрын
Glad it helped!
Yesss! I have finally done it🤘. Thanks you so so so so much... I am trying to do this setup from last 6 days and i constantly failed while doing this. i have seen many videos on this topic but they all were not working for me. But today suddenly i found your video on c/c++ setup and i thought "ok let's try another video " but ... Now i think clicking on your video was a great decision. I have seen your both videos : gcc and vs code setup. I am finally so happy that it worked, thank you so so much.
@LearningLad
3 жыл бұрын
Pleasure
wow ,oh my. I have searched "many many" videos and articles to find this problem until I meet this! It's a very cool video just take 7mins. Thanks, that's very helpful .
@LearningLad
3 жыл бұрын
Pleasure
This last part, run in the terminal, is just which I was looking for. Thank you so much.
@LearningLad
3 жыл бұрын
You are welcome!
Your video was simple and easy to follow. I am saving this in a playlist for later!
@LearningLad
2 жыл бұрын
Thank you Keep learning
I just wanted to say thank you. It is very frustrating when you are trying to learn something new and no matter what you do it does not work. Especially when it is not because you messed up what you are trying to learn but because of a setting in the program or on the computer. Thanks to you I know I was doing it correctly the whole time and it was just a setting in VS Code. Thanks again.
@LearningLad
Жыл бұрын
You are so welcome!
Lifesaver! Helped a lot to set up things correctly before my exams coming the next week, thank you!!
Thanks to you I got it! Absolutely fantastic tutorials! Hope you do some stuff in C so we can all learn from you.
@LearningLad
3 жыл бұрын
Thanks, will do!
4:38 but I am getting output like this... " 'gcc' is not recognized as an internal or external command, operable program or batch file." instead of hello world
@GiveBackGlory
2 жыл бұрын
he did not tell how to install compiler to run code
@prog-255
Жыл бұрын
I got same thing
@ishu4370
Ай бұрын
same here
relief! watched so many videos to start up C programming. this video helped so simple and precise explanation
@LearningLad
2 жыл бұрын
Glad it helped!
thank you so much learning lad!! i was so lost in the installation guide of c++ from VS code
@LearningLad
Жыл бұрын
You are welcome!
This is exactly what I was looking for! Thank you for the exhaustive explanation!
@LearningLad
3 жыл бұрын
Glad it was helpful!
Hey,how to configure settings to build a task , debugging it and than creating an executable exe. File. I have been looking for it for months now.no video has helped me till date.either they are too old or are for mac .😭😭
Helped me a alot i have been trying to run a C program on vsc but there was some issue with mingw now after following your steps everything is working fine thanks alot.
@LearningLad
Жыл бұрын
You're welcome!
Thank you so much for the help. I don't know why people clicked on the dislike button when the video is very helpful. Maybe the accent is hard to understand sometimes but I don't care actually. Just focusing on the result. IT WORKS 100% SURE - you got a big thumbs-up from me bro
@LearningLad
2 жыл бұрын
Thank you
man, you really saved my life. I'd been trying to run my code for hours before I saw this video. Thanks :)
Thanks for ur help man. But is there any way to auto refresh the terminal when we run a new code?
Thank you so much I was searching on how to use the input scanf and your tutorials really helped me, thank you very much
@LearningLad
Жыл бұрын
You're welcome!
I HAVE BEEN SEARCHING SO MUCH TIME FOR THIS. THANK YOU MAN, YOURE AWESOME
@LearningLad
4 жыл бұрын
No problem!
THANK YOU! Can't tell you how much I have searched for the input issue.
@LearningLad
3 жыл бұрын
Glad I could help!
@pranjaladhav9600
3 жыл бұрын
@@LearningLad I am still gettotn error😭
After watching so many useless guides I finally found this video! Thank you so much it's all working and functioning now!
@LearningLad
2 жыл бұрын
You're welcome!
thank u sooooooooooo much I had been struggling with it for all these days
Thank you so much!!! By the way, if anyone can't find the "Run code configuration" on the left side, type in "Run code" in the search bar. "Extensions" should show up, and under it will be the run code configuration option. It seems that's changed since this video was published.
@LearningLad
2 жыл бұрын
Thank you for posting this :)
@Vule_20
2 жыл бұрын
I don't get anything popping up when I type "Run code" in the search bar, it doesn't reveal The Run code configuration option under "Extensions"
I got an error saying "The system cannot execute the specified program.". What's do I do?
Thanks for the great tutorial! Followed both videos and they're both so easy!
@LearningLad
2 жыл бұрын
You're very welcome!
THANKS A LOT SIR. I had been trying since a week but couldn't do it. I saw your video and did the same. AND it worked
@LearningLad
2 жыл бұрын
You're welcome!
Thanks bhai tune to jindgi hi badal di.😂 pareshan ho gaya tha in online compilers se. Very very very thanks 🙏🙏🙏
@LearningLad
3 жыл бұрын
glad this tutorial helped you :)
Hey thank you for making it so easy, I was getting crazy using it! Also which one is better and easy and fast VS Code or Codeblocks?
@LearningLad
3 жыл бұрын
both are good :)
Thank you so much! I finally figured out how to compile code in VS.
@LearningLad
2 жыл бұрын
You're welcome!
been struggling with this issue for a week , resolved quickly , thank you!
@LearningLad
Жыл бұрын
most welcome :)
DAAAMN, THANK YOUU BERY MUCH!
@LearningLad
3 жыл бұрын
my pleasure :)
It's amazing sir, nice explanation. And it's helped me alot. Thank you so much.
@LearningLad
3 жыл бұрын
my pleasure :)
@sriram5839
3 жыл бұрын
Hello sir The output isn't coming. Every time I need to press ctrl+s. Please tell me anything to avoid this thanks
i have watched tons of videos about my error none of these videos helped and you fixed perfectly thank you soo much
@LearningLad
2 жыл бұрын
pleasure :)
Thank you so much I've been having Sooo much trouble and now it is finally working, god bless you
@LearningLad
2 ай бұрын
glad my video helped you keep learning :)
I was unable the input in c++. After seeing this video I am able to take input in c++ Thanks you sir
@LearningLad
3 жыл бұрын
Awesome Keep learning :)
This was SO helpful thank you so much!! I spent like 5 hours not realizing I needed a code runner extension 🤦🏽
@LearningLad
2 жыл бұрын
Pleasure
@rajakumarhinchageri5327
2 жыл бұрын
gubad
@rajakumarhinchageri5327
2 жыл бұрын
gubad
@kausthub0454
2 жыл бұрын
@@LearningLad sir, I have installed the vs code and all what u have mentioned but aftr typing the code, when i run it nothing is being shown as output or error...please help sir
after wasting my whole day on just this simple setting i repteadly installed and uninstalled my vscode thinking i am doing something wrong. and then finally i watched this video. thanks a lot man.
@LearningLad
2 жыл бұрын
pleasure :)
Thank you so much that last part has been giving me serious issues for some time now, I'm glad I watched this video.
@LearningLad
4 ай бұрын
glad my video helped you :)
Omg you are a life saver, i wish you only the best in life
@LearningLad
2 жыл бұрын
Thank you
Sir can we have a different console window on run like we have in codeblocks.? That will be more convenient.
great tutorial! helped me so much in just a couple of minutes! thank you so much!
@LearningLad
2 жыл бұрын
Pleasure
Thank you so much! I was going crazy about the whole input thing...
@LearningLad
Жыл бұрын
You are welcome!
Fantastic. Simple and easy to follow Language & to the point (no nonsense talkings to kill time) content. Thanks.
@LearningLad
2 жыл бұрын
Pleasure
This was amazing. Thank you so much for this video. It really helped me a lot.
@LearningLad
3 жыл бұрын
my pleasure :)
Thank you very much .. I was tryg to do the setup for lst many days .And finally did it
@LearningLad
2 жыл бұрын
Great 👍
I had to start coding in c and c++ and this video of yours helped me a lot. thank you so much
@LearningLad
2 жыл бұрын
Pleasure
Thank you for this great tutorial! For those who get the error "undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status" Remember to save your file with ctrl-s before running your code. You can go into extensions and into Code Runner to change the extension's settings Look for Code-runner: Save file before run and tick "Whether to save file before running"
@devanshkmishra
2 жыл бұрын
thanks a lot!!
Crystal Clear. Thank you Sir!
@LearningLad
9 ай бұрын
You're welcome!
Best tutorial out there, was trying to figure this out elsewhere for too long.
@LearningLad
10 ай бұрын
Thank you :)
Thankkkk youuu it's been 3 days I was going crazy thanks to you
@LearningLad
9 ай бұрын
Glad I could help
Before I wanted to try c++ in visual studio code but I was using their tutorial and I was really confused but you made it easily understandable
@LearningLad
3 жыл бұрын
glad it helped :)
@drazenklikovac2964
2 жыл бұрын
@@LearningLad hey bro why does it say in my terminal that File format not recognized collect2.exe: error: ld returned 1 exit status? Im confused
Thnks finally I can do c++!!
@LearningLad
3 жыл бұрын
Awesome Keep learning :)
I have been trying to install both from longer time but was not able to install and run program, both of your videos helped in installation and successfully running the program
@LearningLad
2 жыл бұрын
glad my video's helped you :)
FInally a video that worked for me, I'm starting with C++ and now I can run code, thank you !
@LearningLad
11 ай бұрын
You're welcome!
awesome neat clear explanation I have an error before its ok new subscriber bro
@LearningLad
3 жыл бұрын
Thanks and welcome
Very good video. Simple and straight to the point. Thank you, man.
@LearningLad
Жыл бұрын
most welcome :)
Thanks from Russia! :) Спустя столько лет я наконец-то нашёл руководство которое объяснило бы мне как настроить среду разработки для C!
Thank you so much bro , You're a lifesaver . You solved the problem of years in 15 mins .
I had a problem where the terminal said it "couln't find gcc" or something along those lines. I fixed it by running VSC as administrator.
@jofie2302
3 жыл бұрын
@Furious Edits Use Explorer or command line (dir /S gcc.exe) to try and find the gcc executable. For me the installer installed it in c:\bin for whatever reason. I uninstalled, reinstalled and it worked ok second time around.
hey i followed ur tutorial and when i compiled a simple code, avast blocked this: Win32:TrojanX-gen [Trj] which is apparently a very bad virus, is it possible in anyway that minGW was filled with bad things or something ? (also thanks for the very clear tutorial on this :) )
@LearningLad
4 жыл бұрын
sorry for late reply. if u have installed Mingw from Official Source then no need to worry about malware
@HK-sw3vi
3 жыл бұрын
compare the download hash to see if the download is legit
Finally I've installed it, I just started programming I just hope I'm going the right path, I'll Come back in a few months to tell how my learning is going
@LearningLad
Жыл бұрын
All the best :)
Thank you soo much bro. Ive been trying to code c in VS code but i couldnt and ended up using codeblock but i liked VS Code but now thanks to you, I can finally code C in VS code.
@LearningLad
Жыл бұрын
awesome keep learning :)
If it's still not running for you giving you an "Access Denied" error message. Check and see if you have an antivirus program such as McAfee or Norton, and try turning it off, close Visual Studio Code and open it again and try to run the program.
@swatisaxena5546
3 жыл бұрын
Thanks a ton
My god Awesome bro 🔥🔥🔥🔥 Today my day was fully wasted in this but now 🎉🎉🎉🎉
@LearningLad
3 жыл бұрын
Glad to hear that
Worked like a charm! Thank you.
@LearningLad
Жыл бұрын
You're welcome!
Thanks a lot for your video Sir I literally had to do installing and uninstalling process 3 times until I found you're video. Finally I installed successfully. Min gw and all the extensions. Thanks a lot sir
@LearningLad
Жыл бұрын
You are welcome
You are a freaking legend brother. Thanks a lot for this video.💙
@LearningLad
3 жыл бұрын
My pleasure 😊
Thank you so much for this 😊😊
@LearningLad
2 жыл бұрын
Pleasure
Thank you so much brother for both setup and run code video... ❤
@LearningLad
Жыл бұрын
You're welcome 😊
sir ,i was so tensed that my vs code stoped working for hours but after I watched your video I am able to work again .Thanks a zillion sir.
@LearningLad
2 жыл бұрын
Pleasure
"'gcc' is not recognized as an internal or external command," this is the output i got even though i installed mingw. what should i do?
@vvekmathew
3 жыл бұрын
Add path. Then restart your computer and try again
@rasu84
3 жыл бұрын
@@vvekmathew How do I know the path where gcc is installed
@rasu84
3 жыл бұрын
@@renjithroy8422 Yeah thanks. I figured it out. This video assumes that people have already installed MinGW. Should have been clarified.
@renjithroy8422
3 жыл бұрын
@@rasu84 Great. He had made another video where he explains on how to install MinGW, that's how I figured it out.
@shouryamkumar6158
3 жыл бұрын
@@vvekmathew sir, I did add path to to environment variable but still getting same result. Also the files in my mingw folder are not showing .exe extension. PS. I have 32 bit windows.
Hi, Thank You for making a wonderful video. I am getting an error in the terminal saying bash: cd: too many arguments can you please tell me why I am getting this error and how I can resolve it
@LearningLad
3 жыл бұрын
If your file name or folder name contains spaces then remove them. Let me know whether this solves your issue
Last tip is the chef kiss for me that is the problem i was facing exactly! perfect
@LearningLad
5 ай бұрын
Glad it helped!
Thanks man! Earlier I was unable to get the run button and every time I was running or debugging some debug error was there and I was redirected to the .json file, you made the whole process soooooooo ez.
@LearningLad
2 жыл бұрын
Glad my video helped you
@hanumanjikabhakt9148
2 жыл бұрын
Bhai yr mujhe abhi bhi vahi aa rha kya kru
Am I the only one who is getting ' cannot open source file "iostream" ' :'-( Solution please!!! Okay got the solution: First watch the video in the description of this video!!! Thanks man it worked :'-)
@amolmagar6468
2 жыл бұрын
"Iostream " such file not found but I already download extension plz help if you already solve it
@justbeagoodperson4826
2 жыл бұрын
@@amolmagar6468 Yeah delete all the downloads you did and do all the steps in the video again that might work 👍
@amolmagar6468
2 жыл бұрын
@@justbeagoodperson4826 I have resolved it. I was not given. Cpp extension for c++ file and also gpp instead of gcc.