How to Set up Visual Studio Code for C and C++ Programming

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2022
  • In this video ill show you how to setup visual studio code for c/c++ programming on windows , we will first download and Install C/C++ toolset like mingw which is a c/c++ compiler and then we will download and install code runner extention in vscode.

Комментарии • 958

  • @thecodebear
    @thecodebear  10 месяцев назад +59

    If you can't download mingw from the sourceforge ,try this : drive.google.com/file/d/19tXOe50ktd4Hhv7WIbyMC0s7e5TqlRa1/view?usp=drivesdk

    • @9-daffa.aqylariyadi609
      @9-daffa.aqylariyadi609 10 месяцев назад +2

      thx

    • @gwendolyn484
      @gwendolyn484 10 месяцев назад

      when i run the code it is showing 'Access is denied.' what should i do? i don't have any antivirus programs too

    • @suhasmagar9548
      @suhasmagar9548 9 месяцев назад

      what is the vs code theme you are using?

    • @SparrowWatt
      @SparrowWatt 9 месяцев назад

      i have done everything as in the tutorial and the shit won't work. tried to fix it, reinstall it and nothing works

    • @sasasale
      @sasasale 8 месяцев назад

      Thank you C-Wizard! Holy buckets finally i installed it, now i can continue in cs50x !

  • @mahiranjan5844
    @mahiranjan5844 Год назад +35

    Thanx a lot for this video. The installation process of MinGW has changed and most of the videos are old. Only this one explains the current procedure, thanks a lottt!!!

  • @emanfey
    @emanfey Год назад +36

    This channel gives you exactly what you need

  • @stevefalcigno2092
    @stevefalcigno2092 6 месяцев назад +19

    Just wanted to say thank you! This was simple, and worked for me without problems. Very well done!

  • @someone18879
    @someone18879 Год назад +9

    🤩Thanks man, finally got my C program compiled and ran in VS Code, woo-hoo! :D

  • @cristianvillalobos7701
    @cristianvillalobos7701 11 месяцев назад +21

    You are incredible! This was super thorough, so many other videos led me down the wrong path.

  • @EnochKabange
    @EnochKabange 8 месяцев назад +9

    Worked like a charm. I had to restart VS Code to effect the changes as I was having errors of "GCC not blah blah" until I restarted the software. Thanks!

    • @betulbozduman8886
      @betulbozduman8886 4 месяца назад +1

      I have the same problem. How did you restart VS Code?

  • @tutkualtas9108
    @tutkualtas9108 Месяц назад

    You can't imagine how much it helped me, I was searching for this information for a very long time.

  • @notorious4745
    @notorious4745 11 месяцев назад

    thank you so much man! I have been struggling with this for like a day and every other video did not work, you rescued me

  • @akakiburjanadze2387
    @akakiburjanadze2387 11 месяцев назад +170

    thanks for the easy tutorial! configuration is way much harder than coding itself 😄

    • @thecodebear
      @thecodebear  11 месяцев назад +8

      Lol ! I'm glad it helped

    • @franciscopena6612
      @franciscopena6612 11 месяцев назад +4

      Nah fr😵‍💫

    • @Ziiio
      @Ziiio 10 месяцев назад +24

      idk why microsft not just make c++ as the base code language without setup like this. It's so pointless

  • @cartierdreams9856
    @cartierdreams9856 11 месяцев назад +36

    Definitely precise and to the point, if the script doesn’t work once you install, restart your device and open up VScode it should work fine

  • @pacerbx3084
    @pacerbx3084 Год назад +34

    I tried another video, it told me to download some msys64 stuff, afterwards it told me to download some packages of mingw and that took over 15 mins. Finally when I thought it was done, I checked and it showed that there was some errors and the download was interrupted. Overall this whole process took me an hour and 30 mins until I found your video. LITERALLY! IT TOOK ME LESS THAN 5 MINS WHEN I WAS FOLLOWING UR GUIDE! Just know that I love this your video's and your a lifesaver!

    • @vd9570
      @vd9570 10 дней назад

      true
      and the funny thing is that video has more views than this one
      WHAT A FOOKIN TIMEWASTE

  • @joshuageorge9679
    @joshuageorge9679 3 месяца назад

    Thank you so much for this genuinely, I had been trying different things for almost 2 hours and now all my errors are finally fixed, thanks a lot!!

  • @jasonconrad7625
    @jasonconrad7625 10 месяцев назад +3

    Best guide that I've come across. Thank you so much!

  • @vixenin
    @vixenin Год назад +8

    omg I was struggling so much with Visual Studio, I didn't knew mingw was a thing

  • @mansimewara9463
    @mansimewara9463 Год назад +2

    Thanks a lot because of your video I was able to install the gcc properly and run C++ code !!!

  • @youtubeuser2352
    @youtubeuser2352 Год назад +44

    It worked! Concise and straight to the point.

  • @JustBasicJoseph
    @JustBasicJoseph Год назад +6

    Thank you So So Much, I've been trying to figure out why my code wouldn't output. But now I am able to use Visual Studio Code because of you. Thank you so much!

  • @MamaMia84oo7
    @MamaMia84oo7 Год назад +19

    This man is a genius. He has figured out how to time travel. He just simply says “ Im going to fast forward” it happens, he travels into the future. Why isn’t anyone talking about this??!!??

  • @UddhavBanik
    @UddhavBanik 4 дня назад

    Very helpful. I was trying to fix the issue of my code not running at all when I stumbled across this video. Worked for me very well

  • @yourty3966
    @yourty3966 11 месяцев назад +22

    Thank you very much. I'm a rookie programmer who is only 18. But I love programming very much and I'd like to use vs code to program. I used to code python which is the simplest program language and already set up in vs code. So I don't need to do anything to activate it like C++. But when I wanted to try C++. I found it doesn't work at all. I tried to change some setting in vs code but it doesn't work still. After watching this video I finally know actually I should install MinGW and code runner. Thank you very much. I'll keep coding

  • @jhazztill132
    @jhazztill132 10 месяцев назад +3

    I spent 3 days and some change to find the correct compiler path, and you literally save me!

  • @husnashariff568
    @husnashariff568 Год назад +4

    Since 3 months now I can run the code successfully... Ahhh... Thanks a lot bro..

  • @xolilengcobo9969
    @xolilengcobo9969 9 месяцев назад

    Thank you it worked🙏, It's been more than a month trying to run my codes

  • @devansh_903
    @devansh_903 Год назад

    thanks it worked. after struggling with it for months, finally the problem is solved.

  • @jcwljs1246
    @jcwljs1246 Год назад +5

    Thank you soooo much. You made it sound so simple.

  • @naderbazyari2
    @naderbazyari2 Год назад +4

    It saved me a lot of headaches. Thanks a million.

  • @user-rl6qh1gt2v
    @user-rl6qh1gt2v 10 месяцев назад

    bro earned a subscriber, i had been struggling from hours on it

  • @Lelouch-vi-Britania
    @Lelouch-vi-Britania 8 месяцев назад +2

    ThankYou Bro I was stuck at this for 3 days finally found this wonderful tutorial you deserve a sub ❤❤

  • @JoseEspinoza-ht8cx
    @JoseEspinoza-ht8cx Год назад +6

    Excellent Kumar, straightforward, simple and easy. Thanks

  • @jamesbondisamonkey
    @jamesbondisamonkey Год назад +5

    This was very nicely done, great video!Thank you.

  • @WisdomOkereke
    @WisdomOkereke 2 месяца назад

    Love this. Easy and straight to the point. My codes started running instantly 😇😇

  • @beng6319
    @beng6319 11 месяцев назад +2

    Thanks mate! I finally ran my first c++ program :)

  • @devvv4616
    @devvv4616 Год назад +47

    thanks, straight to the point without fluffs

    • @thecodebear
      @thecodebear  Год назад +4

      🙌

    • @surajbokade66
      @surajbokade66 Год назад +3

      ​​​@@thecodebeary, Everything was going perfect but after compiling (gcc file.c) .exe file was not creating...as a result, after giving command .\a.exe, code is not running
      Plz help

    • @surajbokade66
      @surajbokade66 Год назад +2

      After reinstalling it's working now...

  • @MissoyKE
    @MissoyKE Год назад +8

    Thank you for this video my friend.
    Really cleared up a lot for me.

  • @FaithForGod
    @FaithForGod Год назад

    Thank you after like 5 videos nothing worked till I watched yours thx

  • @simplylokaamv3541
    @simplylokaamv3541 9 месяцев назад

    Omg thank sooo much I need to ran it for college , such easy explanation
    If you face any problem on cmd close and open it again

  • @gabehanby6646
    @gabehanby6646 Год назад +351

    If you're getting an error in vscode after trying to run your scripts, you likely did nothing wrong try restarting your vscode after you've installed and added mingw to your path.

    • @grimmister
      @grimmister Год назад +49

      Thanks man, this helped. "For those who are still facing the error "gcc is not recognized". Just type "set Path=C:\MinGW\bin;%PATH%" and press enter." also helped me before that.

    • @pushkarpandey3513
      @pushkarpandey3513 Год назад +6

      ​​@@grimmister where to type this in terminal or any other ?

    • @thecountofgoldmoor1332
      @thecountofgoldmoor1332 Год назад

      Thank you so much!

    • @SunilSuni-qd3ed
      @SunilSuni-qd3ed Год назад +1

      Tq very much brother it helped a lot ♥️♥️

    • @kamranshehzad6560
      @kamranshehzad6560 Год назад +2

      ​@@SunilSuni-qd3edIt still not work written as system cannot find the path specified what should I do now ?

  • @lokesh666
    @lokesh666 Год назад +5

    Thank you so much man. It's really helpful ✌️✌️

  • @user-ib5mj2rc8e
    @user-ib5mj2rc8e 6 месяцев назад +1

    That was the most helpful video I've even seen and thank you for making it short

  • @7clouds26
    @7clouds26 21 день назад

    thanks code bear i ran out from a big setup problem today by watching urs tutorial

  • @SperkSan
    @SperkSan 11 месяцев назад +4

    Great video, i was having trouble installing the compiler and this video helped me

  • @axpers99
    @axpers99 Год назад +236

    For those, who gets an error even after adding environment variable (path). You can add it to system path, and relaunch you cmd. It will work just fine.

    • @ArchanaKumari-wh9dj
      @ArchanaKumari-wh9dj Год назад +5

      but how

    • @axpers99
      @axpers99 Год назад +14

      @@ArchanaKumari-wh9dj In your start menu, search for env, click on "Environment Variables", then in the "System variables", double click on "Path", "new" and insert the path there.

    • @jeramiahcogar8277
      @jeramiahcogar8277 Год назад

      That's not eirking

    • @jeramiahcogar8277
      @jeramiahcogar8277 Год назад +2

      Working

    • @ArchanaKumari-wh9dj
      @ArchanaKumari-wh9dj Год назад +6

      @@jeramiahcogar8277 try to save ur code b4 running maybe it worked for me

  • @gobbogrob
    @gobbogrob Год назад +1

    you literally saved me from burning my nerves THANK YOU

    • @thecodebear
      @thecodebear  Год назад +1

      😂 you are welcome , dont forget to like and sub

  • @MarkoStrelica
    @MarkoStrelica 7 дней назад

    Tnx bro!!! I've been trying for three days... your video is the only successful one

  • @Pickle236
    @Pickle236 Год назад +5

    This helped SOOOO much!!! I can finally do C/C++ and am not stuck to Java Python HTML JS CSS and Bash!!!

  • @the5gguru
    @the5gguru Год назад +5

    Thanks. Short and to the point!

  • @sushmaranjan2135
    @sushmaranjan2135 Год назад +2

    Thanks it works finally some concise and to the point video.

  • @suhasmagar9548
    @suhasmagar9548 9 месяцев назад +2

    Short and to the point great!

  • @demirbaydemir8496
    @demirbaydemir8496 7 месяцев назад +41

    If your having troubles about vs code not finding the g++ command of your MinGW, at this point of tutorial (3:52) when you created a new variable as your path move that to the top by using the move up button, then restart your terminal/vs code and that should work.

  • @Alex-wg9bi
    @Alex-wg9bi 10 месяцев назад +4

    Simple and easy to follow, thank you!

  • @Oriolesgmufan
    @Oriolesgmufan Год назад

    Thant You! Been trying to figure this out forever.

  • @mairait
    @mairait 7 дней назад

    thanks a lot for this video. its helped me alot.i was troubling with it for many days but finally i find the solution.the best video on youtube.

  • @MJ-lo5ik
    @MJ-lo5ik 10 месяцев назад +4

    Thank you very much. I was lost at first and thought “why do I need to do all these steps?” Because in my school the PCs were probably already setup. I was a bit skeptical 😅 and to be fair I’m still a bit worried if I did anything wrong but nevertheless I am able to code in VS now.

  • @farhanrejwan
    @farhanrejwan Год назад +18

    So much easy, clear and straightforward! Many Thanks!

    • @am_dazzle
      @am_dazzle Год назад

      Hii, Farhan can you help me out to solve this error I have tried everything reinstalled MINGW but still it is showing error

    • @farhanrejwan
      @farhanrejwan Год назад

      @@am_dazzle sure, i'll try. what error are you facing?

    • @am_dazzle
      @am_dazzle Год назад +1

      I don't know what's going on brother please help me 🙏🏻
      Can you tell me if I share my screen

    • @farhanrejwan
      @farhanrejwan Год назад

      @@am_dazzle i'm not so sure unless i see it

    • @am_dazzle
      @am_dazzle Год назад

      Can you give me your Instagram id so that I can send you a screenshot

  • @funlife3342
    @funlife3342 2 месяца назад +2

    finally !!!! Thanks a lot .... saw lots of video... tried again and again ..... followed your steps just once and its working .....thankyou very much !!!!!!

  • @sigmaviscount6631
    @sigmaviscount6631 Год назад +2

    You are a lifesaver! Thank you so much. It worked 100%

  • @evarosesummerfield9311
    @evarosesummerfield9311 Год назад +5

    Thanks so much for this - really concise and helpful! :)

  • @helltanker19
    @helltanker19 Год назад +30

    Thanks for the guide. This is actually clearer than the docs from Microsoft!

    • @thecodebear
      @thecodebear  Год назад +4

      Im glad it helped

    • @edwardmacnab354
      @edwardmacnab354 Год назад +11

      microsoft is the very last place you go for clarity. Everything microsoft does is tainted with weirdness. The Bill Gates Vibe I guess !

    • @anon-fz2bo
      @anon-fz2bo Год назад +1

      u do realize this version is not 64 bit right. also u won't have to newest versions of the compilers and headers.

    • @anon-fz2bo
      @anon-fz2bo Год назад

      @@edwardmacnab354 u sound like a noob who knows nothing tbh. the Microsoft docs were fine 😂

  • @brainelomoni6108
    @brainelomoni6108 11 месяцев назад +2

    He was the average RUclipsr until the last moments of "The C++ program tells you to subscribe..."🤩

  • @RohitSingh_07
    @RohitSingh_07 Год назад +2

    Thanks man. Was very helpful!

  • @kxngduvie7682
    @kxngduvie7682 11 месяцев назад +10

    Just started learning c++ for my autonomous mobile robotics class and I was running into problems but this helped, thank you.❤

  • @crouserhd297
    @crouserhd297 Год назад +3

    great work. You helped me so much :D

  • @muhammadosama8517
    @muhammadosama8517 10 месяцев назад

    Thank you for this tutorial. It worked perfectly fine.

  • @hasseaouled6032
    @hasseaouled6032 10 месяцев назад +1

    Worked perfectly. Thank you, sir.

  • @michaelslifecycle
    @michaelslifecycle Год назад +30

    In cs50 they just went straight into teaching us code on VS code and completely skipped telling us how to set it up. I was completely dumbfounded getting so many error messages just trying to type hello, world XD

    • @sbmod3083
      @sbmod3083 5 месяцев назад

      I'm going through the same thing

    • @demonyt3296
      @demonyt3296 5 месяцев назад

      Yes exactly the same

    • @user-gd9bx3ug4f
      @user-gd9bx3ug4f 5 месяцев назад

      Me as well

    • @ignacioenriquemendezchavez5912
      @ignacioenriquemendezchavez5912 4 месяца назад

      I thought the same thing but actually David mentions that they are using their cloud version
      Witch you can access very easily in the page of cs50, I don’t know if any of you are taking it entirely on RUclips but the page has a ton of information besides the lectures, like de duck AI, vs code for cs50, GitHub access for the problem sets and more información about the topics.

    • @MrSanfrinsisco
      @MrSanfrinsisco 4 месяца назад

      The reason for this was because people actually in that class were given a cloud based version, meaning they didn't have to install anything and were able to just jump in and start coding. Then much later on down the line David mentioned he would help them install it onto their computers so when the class was over they could continue working on projects even if it's the only class they take, but for everyone else, yea we have to just figure it out lmao

  • @NityamJoshi-uv8bh
    @NityamJoshi-uv8bh Год назад +8

    detailed and clear. super helpful.

  • @Manuel-vz3cu
    @Manuel-vz3cu 4 месяца назад

    ive been trying to compile my code for a week now but all the instructions i got were BS, thank you for the help!

  • @Casey01023
    @Casey01023 4 месяца назад

    Thank you for this video, it helped me alot and was very easy and simple to follow!

  • @letsplaysandplaythroughs5241
    @letsplaysandplaythroughs5241 11 месяцев назад +3

    I have been trying to figure this thing out for 2 hours now, thanks to you i did it in 2 minutes. Thank you so much.

  • @27anshulsd
    @27anshulsd Год назад +8

    Just tell your viewers to restart VSCode if it was already open. Otherwise, very straightforward instructions.

  • @manek8886
    @manek8886 Год назад

    thank you so much i was tying to run c++ in visual studio for few days

  • @ejakpevweogheneonosemuode1409
    @ejakpevweogheneonosemuode1409 8 месяцев назад +1

    Thanks alot, what a straight forward solution!

  • @en_podcastshorts
    @en_podcastshorts Год назад +4

    Straight to the point. Keep up the work!

  • @damianjankov3343
    @damianjankov3343 9 месяцев назад +1

    thanks, works, very brief and easy to follow

  • @shishirr775
    @shishirr775 Месяц назад +2

    After countless videos, this was the only one that worked for me. You are a lifesaver!
    Edit : Please help, it runs just fine but does not let me input any values in the output tab, I unchecked read- only attribute and it still doesnt work. Please please help

  • @mugdhamonga25
    @mugdhamonga25 Год назад +4

    Loved it, short and accurate

  • @aspiringprogrammer2820
    @aspiringprogrammer2820 8 месяцев назад +5

    This got to be the funniest thing ever,i did precisely everything you did,and it was going well,all of it,and in the very end when i clicked to run the file it appeared that gcc is not reconized as a internal or external command,im always out of luck with this computing tutorials,every single video it doesnt work for me,always,but thanks anyway XD.

    • @thecodebear
      @thecodebear  8 месяцев назад +2

      there you go buddy , ruclips.net/video/8xNhnmF9ATs/видео.html

    • @NoName-is9qv
      @NoName-is9qv 8 месяцев назад

      Every single video/tutriyal

    • @NoName-is9qv
      @NoName-is9qv 8 месяцев назад

      Hahahaha

  • @TylerSmith-ep7gk
    @TylerSmith-ep7gk 10 месяцев назад

    I could marry you right now, took ages to figure this out. Watched other videos and none explained it as clear as you did

  • @kaveenkawsal5246
    @kaveenkawsal5246 3 месяца назад +3

    'gcc' is not recognized as an internal or external command,
    operable program or batch file.

  • @usmankhawar888
    @usmankhawar888 11 месяцев назад +11

    'gcc' is not recognized as an internal or external command,
    operable program or batch file.
    error in vs code

    • @maskguy8436
      @maskguy8436 5 месяцев назад

      We got same problem bro

    • @usmankhawar888
      @usmankhawar888 5 месяцев назад

      @@maskguy8436 This is maybe due to this tutorial is meant for C not C++
      Use "code blocks" for C++ much easier setup

    • @chungvu1296
      @chungvu1296 Месяц назад

      same problem

  • @prabhatkumarram8541
    @prabhatkumarram8541 День назад

    a big thanks from all the beginners.

  • @FrankStranathan-qj6et
    @FrankStranathan-qj6et Год назад +2

    Great walkthrough!

  • @mauricioquiroga7209
    @mauricioquiroga7209 Год назад +5

    Yes it works but, when the program needs the user to do some input, I cannot act as an user to enter input into the window, how do I fix this?

  • @sameermeshram3610
    @sameermeshram3610 11 месяцев назад +8

    If anyone getting error just try to add the path in System variables rather than User variables it really helped😊

  • @spurs5128
    @spurs5128 9 месяцев назад +1

    Thank you so muchh, finally a worthy video

  • @manojpowar5445
    @manojpowar5445 22 дня назад

    Thank you so much. It helped me a lot.

  • @user-lu8hj4tt3k
    @user-lu8hj4tt3k Год назад +4

    Hello, you put cc Cambodia for me to see easily❤️❤️

  • @ranjithamahadevu5015
    @ranjithamahadevu5015 11 месяцев назад +6

    I got no errors in the command prompt but while running the programs it is showing, 'gcc' is not recognised as an internal or external command, operable program or batch file. How to fix it?

    • @JarppaGuru
      @JarppaGuru 5 месяцев назад

      open command promt and write gcc. is it working? if not then system path not setup. it cant find gcc.exe magically. you need tell what folder is it
      i open terminal on vscode
      gcc -o test.exe test.c
      boom! zaam! no need any extensions. it means i can easy use notepad and console like 20 years

  • @AmaraMySon-ob8yy
    @AmaraMySon-ob8yy 5 месяцев назад

    Thank you sooo much. This helped a bunch!.
    God bless you sir❤

  • @Raghuvar11
    @Raghuvar11 4 месяца назад

    Thanks for this video, it helps me amazingly. ❤

  • @furkangunes04
    @furkangunes04 Год назад +8

    Not working in Windows 11 and recent Visual Studio Code, and other plugins!

  • @masterfbc2725
    @masterfbc2725 7 месяцев назад +8

    The following error appeared in the terminal for me: " 'gcc' is not recognized as an internal or external command, operable program or batch file."
    What do I do?

    • @aymeen4465
      @aymeen4465 5 месяцев назад

      Bro leave a space between gcc and -

    • @bryancorona8393
      @bryancorona8393 4 месяца назад

      ran into the same issue, make sure you click "new" then paste, then ok. I had the issue because i didnt press "new" and then paste it but just clicked the blank space and typed it in then pressed ok, which then it didnt work. Hope this helps for anyone

  • @tamalmazumder8476
    @tamalmazumder8476 8 месяцев назад

    Thanks...your video works like a charm everytime

  • @irongaming5996
    @irongaming5996 Год назад +1

    thankyou thankyou thankyyou thankyou soooo much i can't describe my happiness in words i was trying so hard i watched half of the youtube for this. finallly the best decision you made in your life is this video ❤❤❤❤❤❤❤❤❤❤❤❤

  • @germeswinpordcanillo6910
    @germeswinpordcanillo6910 Год назад +6

    it is giving me the "error compiling" and the g++ is not recognized as a internal or external command
    :((((

    • @tarzantiger7927
      @tarzantiger7927 Год назад

      Yep, you need to install mingw , once done the error is resolved

    • @saniyasaniya8672
      @saniyasaniya8672 Год назад

      @@tarzantiger7927 nahi hora..

    • @tarzantiger7927
      @tarzantiger7927 Год назад

      @@saniyasaniya8672 just check apne mingw ka path add kiya hai ki nahi / you are debuging the code in place of running it

    • @guggliamsaiprabhat8513
      @guggliamsaiprabhat8513 Год назад

      @@tarzantiger7927 I am getting command not foub even though I have added path

  • @andreianghelea6877
    @andreianghelea6877 Год назад +6

    It sadly gives me an error when i try to run/debug the code stating that the file executable does not exist while I can see it exists in the same folder I am working on.

  • @Chrollo_x2
    @Chrollo_x2 Год назад +1

    thanks man, no one was actually telling the truth that we need to install mingw minimalist GNU instead mingw w64

  • @charanks8681
    @charanks8681 Год назад +1

    This video made me easier to install.thank you brother

  • @ufallo
    @ufallo Год назад +3

    for anyone getting gcc not recognized even after manually adding the path in environments (mine kept disappearing),, in the cmd prompt type set Path=C:\MinGW\bin; took me 10 syntax errors to figure it out lol YOU HAVE TO TYPE IT EXACLY LIKE THAT
    set Path=C:\MinGW\bin; (I INSTALLED ON WINDOWS 10 C DRIVE)