How to set up Visual Studio Code for Executing and Debugging C++ Programs | Tutorial for Beginners

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

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

  • @ВасяПетрович-л2ш
    @ВасяПетрович-л2ш 2 года назад +13

    At first, the program in the VS Code terminal did not start for me (initially, the "Powershell" terminal was selected). Then I selected the "Command Prompt" terminal (the "Launch Profile" button next to the "New Terminal" icon at the bottom right of the screen, then select "Select Default Profile" and in the drop-down list - "Command Prompt"). After that everything worked. Many thanks to the author for the detailed instructions and the work done!

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

    This is, most probably the best video for VS Code Configurations setup. I learnt so much and got curious about tasks.json and launch.json, that I learnt how to write configurations by myself. Now I do it my way, thanks Sir for this tutorial which was the stepping stone.

  • @naamnhibataunga5897
    @naamnhibataunga5897 7 месяцев назад +2

    only this video has worked for me, for configuring debugging option in my vs code..
    just because of this i had shifted to lazyvim... now it feels happy to be back again

  • @gentsci65
    @gentsci65 2 года назад +3

    Thank you so much! After watching many tutorials and getting stuck on how to set up the debugger, this video helped me successfully run the debugger!

    • @LearningLad
      @LearningLad  2 года назад

      Awesome

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

      I was wondering why when I ran, "Hello World.exe" in the terminal it was just displaying it as a string array. Thanks!

  • @chuongnguyen4980
    @chuongnguyen4980 3 года назад +3

    your video teaches me many things that I can't learn from the books or lecture. It provides all things to get start without tedious google. Thanks alot.

    • @LearningLad
      @LearningLad  3 года назад

      Pleasure

    • @yogesh2395
      @yogesh2395 3 года назад

      @@LearningLad Sir can you please make such video for Java also, like launch Json and other stuffs related to build and run java programs in Vs Code

  • @captainvideo9087
    @captainvideo9087 2 года назад +9

    Microsoft has such a great product in VSCode but I’ve always found their tutorials lacking when it comes to personalizing your environment. I learned more from this video than from anywhere else. Keep up the good work!

    • @LearningLad
      @LearningLad  2 года назад

      Thanks :)

    • @sarthaksachdev197
      @sarthaksachdev197 2 года назад

      @@LearningLad hey mine is not working its showing a completely different error after doing 17 minutes of this video

  • @arieverburgh5148
    @arieverburgh5148 2 года назад +2

    Thank you very much, sir. You've made my day! I couldn't get it to work, and googled unsuccessfully for quite some time, until I found your video.

  • @gerhardlourens
    @gerhardlourens 2 года назад +7

    Excellent tutorial! I've spent the last 5 hours using this video along with the one about installing MinGW-w64 and Msys2 to finally get my debugger to run. Learnt a lot in the process. Thanks a mil!

  • @nityunjgoel1438
    @nityunjgoel1438 3 года назад +41

    I'm just in love with this video man!! It was so great! You explained the entire process right from the basics and it was just too good to be expressed in words. 15/10 for this one.🔥🔥🔥🔥🔥

    • @LearningLad
      @LearningLad  3 года назад +1

      Glad you liked it!

    • @quirkyquark99
      @quirkyquark99 3 года назад

      @@LearningLad Sir, when I click "Run and Debug" it says, FAILED TO PARSE JSON FILE, POSSIBLY DUE TO COMMENTS OR TRAILING COMMAS. Please help.

  • @drhf1214
    @drhf1214 7 месяцев назад +1

    So helpful! I am taking CS50 and needed to get C working on VSCode. This worked!

  • @gran-roan
    @gran-roan 2 года назад +1

    Wow, something so simple like learning about the Command Palette (what an obfuscating name, should be like "Search Commands" or something) pretty much solved my doubts.
    Thanks!

  • @HimanshuSingh-ov9gq
    @HimanshuSingh-ov9gq 2 года назад +3

    Thank you so much for this video. It is highly valuable. It teaches professional C++ software development environment setup (MinGW64 toolchain via MSYS2 and VS Code) in a right way. We are thankful to get educator like you. God bless you!

  • @thatsalot3577
    @thatsalot3577 3 года назад

    oh my god, i can't believe i found this video this is literally what i've been searching for months.

  • @justsurajp
    @justsurajp 3 года назад +13

    This is amazing! Always wanted to know a way to debug programs while writing programs for competitive questions!
    Finally, I can use a debugger of my own! :D

  • @lucasboytim7104
    @lucasboytim7104 2 года назад +2

    most accurate tutorial for anything ive ever seen

  • @juanmanuelgomez8572
    @juanmanuelgomez8572 3 года назад +5

    Thank you very much!!! Way simpler and better explained than the VSCode web page.

  • @kondziolkaptr
    @kondziolkaptr 2 года назад

    I had problems with setting this shit up since last 6 freakin' hours until I found your channel. You're my hero

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

    I thank you for your time and effort into making this video. This is an excellent video. Well thought out and the sequence of presentation is very good.

  • @gibaeklee3390
    @gibaeklee3390 2 года назад +1

    Thank you so much! This video solved my debugging problem which was lasting for long time.

  • @huongnguyenmanh8559
    @huongnguyenmanh8559 2 года назад +2

    Your instructions are very clear. Thanks for your video. I have subscribed to the channel. By the way, I wish India a speedy end to the covid epidemic. Love from Vietnam ❤❤❤

  • @robinharris4706
    @robinharris4706 3 года назад +3

    Excellent explanation - found I could follow along with each step. You have a very effective style - thank you

  • @HELLWALKER-ks8lu
    @HELLWALKER-ks8lu 2 года назад +1

    NO ONE DOES IT BETTER!
    thx learningLad

  • @HarishSumant
    @HarishSumant 3 года назад +2

    Thanks, Anil!
    This is just what I wanted!

  • @holder21
    @holder21 3 года назад +2

    I appreciate your job, thank you. Can you make a video Executing and Debugging C++ Programs with C++ Build Tools for VSCODE, many of us have the same problem!! Nice job, thanks a lot

  • @shitshow_1
    @shitshow_1 3 года назад

    That Debugging Part, you explained it in a nutshell __/\__

  • @vikrantmehta-rx2hv
    @vikrantmehta-rx2hv Год назад +5

    i am getting the following error, can you help me with this "the token '&&' is not a valid statement separator in this version"

    • @s.shirani1244
      @s.shirani1244 8 месяцев назад

      try replacing && with ;

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

      I am getting the same error

  • @walid4588
    @walid4588 2 года назад

    Thank you for this tutorial. this is very helpful.

  • @grasshopper005
    @grasshopper005 2 года назад +2

    thanks a lot bro.
    this video is really helpful.

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

    I thought it would have been a little less difficult to get my VS code and c++ Work Space set up. I'm very grateful for you. But if I was on my own doing that there is no way. The compiler integration was very rough but how is anyone able to understand what's going on. I guess I do need to go learn some C.

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

    thanks for the great explanation

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

    I really thanks for your helping, it's save my time :') I really appreciate it.

  • @mcdove
    @mcdove 3 года назад +4

    Nice. Can you do a video using cmake & make setting up the correct folder structure for a project while linking to any external header files?

  • @sunnychy86
    @sunnychy86 3 года назад +9

    Sir,when i try to debug, it says," launch: program ' directory/debug/outdebug' does not exist. ", how to solve this problem?

    • @DiceKnight
      @DiceKnight 2 года назад

      Did you ever figure it out?

    • @sushilmhetre8625
      @sushilmhetre8625 2 года назад +2

      Did you get any solution? 🤯 Stuck with this for so long now!

    • @sushilmhetre8625
      @sushilmhetre8625 2 года назад

      @@DiceKnight ??

    • @sunnychy86
      @sunnychy86 2 года назад +1

      @@DiceKnight I am sorry for replying late, actually I stopped coding in C++ long time ago as nowadays I mostly code in python, js, html and use pycharm for my work. It was fun solving problems in C++. As far as I remember, I fixed this problem but I forgot how. :(

    • @Govt_and_tech
      @Govt_and_tech 2 года назад

      How to solve it bro..?

  • @carlosribe2409
    @carlosribe2409 2 года назад +1

    Thank you so much for this fantastic tutorial! subscribed and shared :)

  • @yogesh2395
    @yogesh2395 3 года назад +1

    Sir can you please make such video for Java also, like launch Json and other stuffs related to build and run java programs in Vs Code

  • @andyw1761
    @andyw1761 3 года назад +2

    Outstanding tutorial!
    This video really helped me get started. The presentation is very clear and explains very clearly how to run and debug a simple first program.
    Thank you so much.

  • @shivangitripathi1423
    @shivangitripathi1423 3 года назад +1

    Thank you for your indepth tutorial. It really helped me a lot.

  • @HKSNGU
    @HKSNGU 2 года назад +2

    I have getting an error saying that token '&&' is not a valid statement seperator in this version
    Please respond

  • @saitejalabba
    @saitejalabba 3 года назад +1

    Very well explained Sir Thank You!

  • @Manojlofi
    @Manojlofi 3 года назад +1

    thanks So much, it's really useful ❤️🔥🔥🔥

  • @WalterDrake04
    @WalterDrake04 2 года назад +1

    Thank you very much, finally i can use debug on my visual code

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

    no need to do 13:28 (for me only)
    Run in terminal video (watch)
    For debugging we have to use debugger symbol on the top right corner

  • @bv1495
    @bv1495 3 года назад +1

    Fantastic Walkthrough mate!! Would you be able to make a series of tutorials for WINAPI debugging ?

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

    Brother, I am getting error after adding double quotes and backslash. I have checked double checked everything while typing. Should I change "cwd" to bin of Mingw because its showing ${fileDirname} on my pc.

  • @Grandnork-mt2pk
    @Grandnork-mt2pk 3 года назад +1

    Thank you my friend, very helpful tutorial!

  • @Jonathantk33
    @Jonathantk33 3 года назад +1

    GREAT!!! WORKED PERFECTLY

  • @G.T828
    @G.T828 2 года назад

    Do you have any video on how to build and debug c++ projects with multiple cpp files and headers?

  • @urielnavarta
    @urielnavarta 3 года назад +1

    Its working dude, amazing!

  • @communk203
    @communk203 2 года назад +2

    Thank you so so much. But when I initiated debugging, it went well but launch.json file did not generate. Any reason?

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

      You can manually create a launch.json file in Programs/.vscode and paste the following into it, should work then (restart of vscode may be required)
      "version": "0.2.0",
      "configurations": [
      {
      "name": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "C:\\msys64\\mingw64\\bin",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
      "setupCommands":[
      {
      "description": "Enable prettyiprinting for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
      }
      ]
      }
      ]
      }

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

      @@ThEmArIS1 Thank you :)

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

    LOVE THE PROGRAM

  • @Game666God
    @Game666God 2 года назад +2

    I got to the point where you use the Run and Debug button and the drop down comes up, but when I click the GDB selection it just disappears with nothing happening, help?

    • @Game666God
      @Game666God 2 года назад

      I found out that the Run and Debug button isn't creating the launch.json file so I copied the one you had up and it still didn't work

    • @nunusvenus7945
      @nunusvenus7945 2 года назад

      same here

  • @yashnishal
    @yashnishal 3 года назад +5

    how can we see the contents of container (such as vector, map etc) while debugging?
    P.S. Thanks in Advance.

  • @ChalkyMuffin969
    @ChalkyMuffin969 3 года назад +1

    You're doing god's work man

    • @LearningLad
      @LearningLad  3 года назад +2

      thank you :)

    • @ahmedmoneimm
      @ahmedmoneimm 2 года назад +1

      You can say he's doing a great job or whatever but you can't say god's work, no jokes here

  • @hiddenthings4820
    @hiddenthings4820 3 года назад +6

    'C:/Program' is not recognized as an internal or external command,
    operable program or batch file.
    The terminal process "C:\WINDOWS\System32\cmd.exe /d /c "C:/Program Files/mingw64/bin/g++.exe" -g3 -Wall "e:\code blocks Projects\C++ Programs\factorial.cpp" -o "e:\code blocks Projects\C++ Programs\factorial.exe" &&"e:\code blocks Projects\C++ Programs\factorial.exe"" terminated with exit code: 1. how to solve it sir.

  • @fahidnfl
    @fahidnfl 2 года назад +2

    After doing "13:27 Configure Task to Build and Run Executable File" this part vs code .......
    "The token '&&' is not a valid statement separator in this version." .............plz help me.............

  • @alisalihi499
    @alisalihi499 2 года назад +1

    Hello
    In the part named "Set up Build Task and Run Program" it doesnt work for me there is no any output.Can anyone help me?
    Thanks.

  • @SreeCharan-dx7oc
    @SreeCharan-dx7oc Год назад

    Very helpfull thanks a lot!!!!!!!!!!!!!!!!

  • @SkSafowan
    @SkSafowan 3 года назад

    Very great video keep up your work !!!
    I don't why my "Run C++ Program: g++" task taking forever to starting build !!! 😑

  • @decemberschild9241
    @decemberschild9241 3 года назад +4

    If you have your file name(eg: "Hello World.exe") printed as result instead of the actual result, what can we do? i tried one of the solutions given few weeks ago, but it gives error!

    • @chetan7841
      @chetan7841 2 года назад

      How did you fix that ,I am having same issue

    • @4thserpent820
      @4thserpent820 2 года назад +1

      @@chetan7841 ./"Hello World.exe"

    • @NCIS-ROHITKUMAR
      @NCIS-ROHITKUMAR 2 года назад +1

      @@4thserpent820 thanks brother I was stuck at this for so long man 🙏

  • @vaibhavverma8033
    @vaibhavverma8033 2 года назад +2

    Bro its showing '&&' is not valid statement separator in this version.....help plzz

  • @deepanshujain1466
    @deepanshujain1466 3 года назад

    wow, the presentation so clear and smooth, Great help in understanding the processess. What softwares were used in making this video.

  • @bhaskarverma4532
    @bhaskarverma4532 3 года назад +1

    loved this video thanks for a lot of help.

  • @shitshow_1
    @shitshow_1 3 года назад +1

    Very Useful !

  • @AttiqKhan
    @AttiqKhan 3 года назад +1

    Bundle of Thanks :)

  • @СофіяДзявроник
    @СофіяДзявроник 3 года назад +1

    Thank you! very useful!

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

    thank you sir but my output is shown in debug console not in terminal at least debugger is working now thank you sir for such valuable content

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

    For anyone who is getting the error message "The token '&&' is not a valid statement separator in this version" when configuring the task to build and run, instead of using '&&' operator, use ';'
    the '&&' operator is not reconized in powershell, the semicolum its the solution!

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

      thanks for posting.
      will help others :)

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

    please help me with this, I have installed a new version of vs code but when I copied your program it says
    && cannot be used as a separator and
    cc1plus.exe: fatal error: World.cpp: No such file or directory
    I really want to learn, please reply!

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

      go through the comment section.
      many have advised to use ; and some other character instead of &&

  • @ttechcell1999
    @ttechcell1999 3 года назад +1

    tank you my frient one more time!

  • @joe_326
    @joe_326 2 года назад +1

    Hey LearningLad, when I press the Run and Debug button, and I press the C++ (GDB/LLDB) environment option, the configuration option popup does not even appear for me to select a g++ configuration option. I need help with this and I tried scouring the internet for solutions but to no avail.

    • @davidroberts5751
      @davidroberts5751 2 года назад

      Did you ever figure this out? I have the same issue, likely due to a new VScode version i imagine but not sure how to solve yet.

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

      You can manually create a launch.json file in Programs/.vscode and paste the following into it, should work then (restart of vscode may be required)
      "version": "0.2.0",
      "configurations": [
      {
      "name": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "C:\\msys64\\mingw64\\bin",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
      "setupCommands":[
      {
      "description": "Enable prettyiprinting for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
      }
      ]
      }
      ]
      }

  • @ayushmanbaksi5195
    @ayushmanbaksi5195 16 дней назад

    Can i follow the process for M1 Mac ? (Considering the file systems according to mac )

  • @shambhvilokre
    @shambhvilokre 3 года назад +3

    I am getting this instead of the output upon running.
    > Executing task in folder projects: C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin\g++.exe -g3 -Wall"c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.cpp" -o "c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.exe" |"c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.exe" <
    The string is missing the terminator: '.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

    The terminal process "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin\g++.exe -g3 -Wall"c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.cpp" -o "c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.exe" |"c:\Users\Shambhvi's pc\Documents\projects\Hello World\Hello world.exe"" terminated with exit code: 1.
    Terminal will be reused by tasks, press any key to close it.
    Please help me. @LearningLad

  • @Kaushik_C
    @Kaushik_C 3 года назад +1

    thanks a lot bro it helped me :)

  • @lharsh175
    @lharsh175 3 года назад +1

    Great Info!

  • @adlg5158
    @adlg5158 3 года назад +1

    Hello, I’m getting the error “Could not find the task ‘C/C++: g++.exe build active file’. Can you help?

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

    thanks a lot you really help me

  • @shubhansu-kr
    @shubhansu-kr 3 года назад +2

    Thanks a lot bro

  • @sankalpjain8192
    @sankalpjain8192 2 года назад +1

    when i write "hello world.exe"it just writes back hello world.exe and dosents open the file
    what to do

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

    Suppose I don't have the .cpp source file but only the binary "a.out", which is already running. Is there a way for me to monitor the variables and expressions after attaching the debugger to the a.out process?

  • @sahila9511
    @sahila9511 3 года назад +4

    At line:1 char:184
    + ... hil\Desktop\vs c++\programmimg\hello world\hello world.exe &&c:\Users ...
    + ~~
    The token '&&' is not a valid statement separator in this version.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine
    what is the solution for this?

  • @alonsoibarrahector8773
    @alonsoibarrahector8773 2 года назад

    I have a question with this i could Executing a more programs in the same folder? , for example if i want to make a big project and separated in differents headears and cpp files and include them in my main.cpp, thank you

  • @hemanthbheemisheety8530
    @hemanthbheemisheety8530 3 года назад +3

    Not working man it's asking to include path settings

  • @thelasthunter8489
    @thelasthunter8489 3 года назад +4

    The token '&&' is not a valid statement separator in this version.
    i have version 5.1.19041.1151

    • @elianyeltzinpaniaguamariac4257
      @elianyeltzinpaniaguamariac4257 3 года назад +2

      tengo el mismo problema

    • @vighneshchavan8059
      @vighneshchavan8059 3 года назад +2

      Same problem mate

    • @sahil1053
      @sahil1053 3 года назад +3

      getting "&&" error try this solution.
      go to view-> select command palate
      type "terminal:Select Default Profile"
      and set to command promat

    • @vighneshchavan8059
      @vighneshchavan8059 3 года назад

      Hello, i got the solution, we just need to update the powershell to latest version, then restart vscode, it works correctly

    • @Citler
      @Citler 3 года назад

      @@vighneshchavan8059 thanks, that was the solution for me!

  • @shambhvilokre
    @shambhvilokre 3 года назад +2

    I am having issue at 13:09 . When I hit enter, Only the text Hello World.exe is displayed. number is 30 Goodbye! is not displayed. Why?

    • @estherohihoin8754
      @estherohihoin8754 3 года назад +1

      Type ".\Hello World" instead

    • @malc_makes
      @malc_makes 2 года назад

      @@estherohihoin8754 This one worked for me!!! thank u !!

  • @ferianji3748
    @ferianji3748 2 года назад

    Please, I need help. I did everything exactly as stated but my vs code constantly highlights my "include " statement which makes my program not run. I love your video and I followed everything so Idk why mine's not working.

  • @Pk3k
    @Pk3k 2 года назад +1

    Very good video but i am stuck on "Run and Debug", I click it and then choose C++(GDB/LLDB) nothing happens, the window just dissapear. Please help

    • @Game666God
      @Game666God 2 года назад +1

      I found what you need to do, go to the Launch.json file and then go to Run -> Add Configurations, then look for C/C++ gdb: Launch... that should add all the correct configurations into the file.
      You will also need to change the Program configuration to the path to your exe, and you will need to change miDebuggerPath as well but I can't seem to get to the debugger path after going through his previous video about setting mingw up
      Hope this helps

    • @NCISAtulPandey
      @NCISAtulPandey 2 года назад

      @@Game666God launch. Jason file has not been created because after c++(gdb/lldb) nothing appears

  • @PANKAIYI수료단과대ESP
    @PANKAIYI수료단과대ESP Год назад

    The fact that my computer refuse to execute g++ ;(((
    prolly a sign that it's time to give up on cs50 ;(((
    why my doesn't work arghhh anyway I'm still trying

  • @zuriglr
    @zuriglr 2 года назад

    A brilliant video.
    before linking the debugger I had a bug with &&.
    The token '&&' is not a valid statement
    Linking the debugger fixed the problem :S

    • @lightning_trade_official
      @lightning_trade_official 2 года назад +1

      hi, can you tell me pls about "Linking the debugger". I have same problem with && token, and i cant understand how fix it
      Ty

    • @zuriglr
      @zuriglr 2 года назад

      @@lightning_trade_official I can try. Please save me some time search through the video and tell me in which minute in the video are you stuck.

  • @NCISAtulPandey
    @NCISAtulPandey 2 года назад +1

    I need help really,🙏🙏
    When I go to create launch. Jason file then after clicking on c++(gdb/LLDB) nothing appears, so launch. Jason file is not created
    Stuck at this for so long now,😢

    • @markdong5875
      @markdong5875 2 года назад

      same issue here...

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

      You can manually create a launch.json file in Programs/.vscode and paste the following into it, should work then (restart of vscode may be required)
      "version": "0.2.0",
      "configurations": [
      {
      "name": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "C:\\msys64\\mingw64\\bin",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
      "setupCommands":[
      {
      "description": "Enable prettyiprinting for gdb",
      "text": "-enable-pretty-printing",
      "ignoreFailures": true
      }
      ]
      }
      ]
      }

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

    Thanks a lot ! 😊

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

    You have to put a ".\" before the exe program, or it won't run.

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

      I was wondering why when I followed the instructions and typed, "Hello World.exe" , it just appeared as a string array as opposed to running the code. this is the reason, Thanks!

  • @shubhamshinde3720
    @shubhamshinde3720 3 года назад +1

    Don't use powershell it will give problem regarding that && symbol use cmd as default

  • @lokeshroy3944
    @lokeshroy3944 3 года назад +1

    Great video

  • @chumbo
    @chumbo 3 года назад +4

    13:09 it doesn't run. The output is just: D:\My C++ Workspace\Hello World>
    I did everthing like you except for the folder structure but I don't think that would matter. My path to the Hello World.exe is correct so....any ideas?
    (The program is valid because I was able to run it correctly in the Windows cmd.exe)
    Thanks,

    • @LearningLad
      @LearningLad  3 года назад +5

      If your code is running in power shell in terminal then choose cmd

    • @ankit-kun279
      @ankit-kun279 3 года назад

      @@LearningLad arigatooo

    • @lukajallow4099
      @lukajallow4099 3 года назад +1

      IF powershell does not load from your current file location, then instead of "Hello Word.exe" type ".\Hello World.exe"

  • @eeshaansawant6396
    @eeshaansawant6396 2 года назад

    sir in the debugging part, while selecting configuration, i selected default configuration by mistake, how should i change it now? my debugging doesnt work.

  • @AkOp-bf9vm
    @AkOp-bf9vm 7 месяцев назад

    sir everything is working fine in debugger but its not executing cout and cin statements. plz reply

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

    + ~~
    The token '&&' is not a valid statement separator in this version.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine [sir i am getting this eror while running the build task ] 23:48

    • @1nv-f1b
      @1nv-f1b 11 месяцев назад

      same error
      edit: i fixed it by updating powershell to it's current version

  • @ahmedfaraz2001
    @ahmedfaraz2001 2 года назад

    i dont get option to add tasks.json C:\msys64\mingw64\bin\g++.exe this isnt shown in my suggestions, but it is installed i checked from cmd

  • @archikashukla7997
    @archikashukla7997 3 года назад

    I am getting an error:
    cd : Cannot find drive. A drive with the name '.C' does not exist.
    At line:1 char:1
    + cd "c:\Users\AS\Documents\C++\" ; if ($?) { g++ test.cpp -o test } ; ...
    + ~~
    + CategoryInfo : ObjectNotFound: (.C:String) [], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound
    please help me what should I do?

  • @saiei
    @saiei 2 года назад +3

    The token '&&' is not a valid statement separator in this version

    • @LearningLad
      @LearningLad  2 года назад +3

      try ; instead of &&

    • @asmita7217
      @asmita7217 2 года назад +1

      @@LearningLad thank you so much. i am currently a beginner and setting up VSC for C and C++ was tough but you made it easier. && wasn't valid for my version either and i was searching for a comment regarding this. Thanks a lot again :)