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!
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.
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
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.
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!
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!
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.🔥🔥🔥🔥🔥
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!
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!
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
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.
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 ❤❤❤
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
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.
@@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. :(
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.
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.
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 } ] } ] }
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?
'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.
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.............
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!
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!
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!
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.
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 } ] } ] }
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
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?
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?
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
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.
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
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
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,😢
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 } ] } ] }
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!
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,
sir in the debugging part, while selecting configuration, i selected default configuration by mistake, how should i change it now? my debugging doesnt work.
+ ~~ 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
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?
@@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 :)
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!
thank you for posting.
it will help others :)
Thanks for this comment, it helped me a lot
Dude a huge thanks to you
Thank you 🖤
Thank u ur comment really helped me ...I was too suffering same problem 😊
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.
Glad it was helpful!
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
Glad it helped
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!
Awesome
I was wondering why when I ran, "Hello World.exe" in the terminal it was just displaying it as a string array. Thanks!
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.
Pleasure
@@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
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!
Thanks :)
@@LearningLad hey mine is not working its showing a completely different error after doing 17 minutes of this video
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.
You are welcome!
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!
You're welcome!
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.🔥🔥🔥🔥🔥
Glad you liked it!
@@LearningLad Sir, when I click "Run and Debug" it says, FAILED TO PARSE JSON FILE, POSSIBLY DUE TO COMMENTS OR TRAILING COMMAS. Please help.
So helpful! I am taking CS50 and needed to get C working on VSCode. This worked!
Glad it helped!
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!
Glad it was helpful!
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!
You're very welcome!
oh my god, i can't believe i found this video this is literally what i've been searching for months.
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
Awesome 👏
most accurate tutorial for anything ive ever seen
thank you :)
Thank you very much!!! Way simpler and better explained than the VSCode web page.
I had problems with setting this shit up since last 6 freakin' hours until I found your channel. You're my hero
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.
Glad it was helpful!
Thank you so much! This video solved my debugging problem which was lasting for long time.
Glad it helped!
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 ❤❤❤
Thank you :)
Excellent explanation - found I could follow along with each step. You have a very effective style - thank you
welcome :)
NO ONE DOES IT BETTER!
thx learningLad
Thanks, Anil!
This is just what I wanted!
Pleasure
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
That Debugging Part, you explained it in a nutshell __/\__
i am getting the following error, can you help me with this "the token '&&' is not a valid statement separator in this version"
try replacing && with ;
I am getting the same error
Thank you for this tutorial. this is very helpful.
thanks a lot bro.
this video is really helpful.
You are most welcome
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.
thanks for the great explanation
Pleasure 😊
I really thanks for your helping, it's save my time :') I really appreciate it.
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?
Sir,when i try to debug, it says," launch: program ' directory/debug/outdebug' does not exist. ", how to solve this problem?
Did you ever figure it out?
Did you get any solution? 🤯 Stuck with this for so long now!
@@DiceKnight ??
@@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. :(
How to solve it bro..?
Thank you so much for this fantastic tutorial! subscribed and shared :)
Pleasure
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
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.
Glad it helped!
Thank you for your indepth tutorial. It really helped me a lot.
Pleasure
I have getting an error saying that token '&&' is not a valid statement seperator in this version
Please respond
Very well explained Sir Thank You!
Most welcome!
thanks So much, it's really useful ❤️🔥🔥🔥
Pleasure
Thank you very much, finally i can use debug on my visual code
You are welcome!
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
thanks for sharing :)
Fantastic Walkthrough mate!! Would you be able to make a series of tutorials for WINAPI debugging ?
I will try
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.
Thank you my friend, very helpful tutorial!
Pleasure
GREAT!!! WORKED PERFECTLY
Pleasure
Do you have any video on how to build and debug c++ projects with multiple cpp files and headers?
Its working dude, amazing!
Glad to hear that
Thank you so so much. But when I initiated debugging, it went well but launch.json file did not generate. Any reason?
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
}
]
}
]
}
@@ThEmArIS1 Thank you :)
LOVE THE PROGRAM
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?
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
same here
how can we see the contents of container (such as vector, map etc) while debugging?
P.S. Thanks in Advance.
same proble did you solved it?
You're doing god's work man
thank you :)
You can say he's doing a great job or whatever but you can't say god's work, no jokes here
'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.
Same here. What was the solution ?
@@محمدفرحانابنشافندي have you fixed this yet sir?
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.............
same with me. did u fix it?
@@ItachiUchiha-mn9di try ";" instead of "&&"
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.
Very helpfull thanks a lot!!!!!!!!!!!!!!!!
You're welcome!
Very great video keep up your work !!!
I don't why my "Run C++ Program: g++" task taking forever to starting build !!! 😑
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!
How did you fix that ,I am having same issue
@@chetan7841 ./"Hello World.exe"
@@4thserpent820 thanks brother I was stuck at this for so long man 🙏
Bro its showing '&&' is not valid statement separator in this version.....help plzz
wow, the presentation so clear and smooth, Great help in understanding the processess. What softwares were used in making this video.
loved this video thanks for a lot of help.
You're welcome!
Very Useful !
Glad you think so!
Bundle of Thanks :)
pleasure :)
Thank you! very useful!
pleasure :)
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
You are most welcome
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!
thanks for posting.
will help others :)
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!
go through the comment section.
many have advised to use ; and some other character instead of &&
tank you my frient one more time!
Always welcome
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.
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.
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
}
]
}
]
}
Can i follow the process for M1 Mac ? (Considering the file systems according to mac )
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
thanks a lot bro it helped me :)
Glad it helped
Great Info!
thanks
Hello, I’m getting the error “Could not find the task ‘C/C++: g++.exe build active file’. Can you help?
Did you solve it?
thanks a lot you really help me
You are most welcome
Thanks a lot bro
Always welcome
when i write "hello world.exe"it just writes back hello world.exe and dosents open the file
what to do
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?
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?
Same here. What was the solution ?
same here
@@nunusvenus7945 use ";" instead of "&&"
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
Not working man it's asking to include path settings
The token '&&' is not a valid statement separator in this version.
i have version 5.1.19041.1151
tengo el mismo problema
Same problem mate
getting "&&" error try this solution.
go to view-> select command palate
type "terminal:Select Default Profile"
and set to command promat
Hello, i got the solution, we just need to update the powershell to latest version, then restart vscode, it works correctly
@@vighneshchavan8059 thanks, that was the solution for me!
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?
Type ".\Hello World" instead
@@estherohihoin8754 This one worked for me!!! thank u !!
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.
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
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
@@Game666God launch. Jason file has not been created because after c++(gdb/lldb) nothing appears
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
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
hi, can you tell me pls about "Linking the debugger". I have same problem with && token, and i cant understand how fix it
Ty
@@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.
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,😢
same issue here...
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
}
]
}
]
}
Thanks a lot ! 😊
You're welcome 😊
You have to put a ".\" before the exe program, or it won't run.
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!
Don't use powershell it will give problem regarding that && symbol use cmd as default
yes :)
How to use the cmd as default ?
Great video
Thank you
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,
If your code is running in power shell in terminal then choose cmd
@@LearningLad arigatooo
IF powershell does not load from your current file location, then instead of "Hello Word.exe" type ".\Hello World.exe"
sir in the debugging part, while selecting configuration, i selected default configuration by mistake, how should i change it now? my debugging doesnt work.
sir everything is working fine in debugger but its not executing cout and cin statements. plz reply
+ ~~
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
same error
edit: i fixed it by updating powershell to it's current version
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
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?
The token '&&' is not a valid statement separator in this version
try ; instead of &&
@@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 :)