问题
Anyone using Visual studio code for programming in C++? Please tell me how can i manage to do the debugging of my code in visual studio code when I'm compiling it using g++ compiler.
回答1:
C++ Debugging requires a couple of steps to configure VSCode for it. Once done then C++ code can be easily debugged with F5.
I wrote a post which guides how to run and debug C/C++ files in VSCode.
https://medium.com/@jerrygoyal/run-debug-intellisense-c-c-in-vscode-within-5-minutes-3ed956e059d6
回答2:
To debug with the Visual C++ debugger, the code must be compiled with the Visual C++ compiler with debug symbols before you can debug. You can make a task.json to do this.
This resource and this resource may help.
来源:https://stackoverflow.com/questions/46060779/how-to-debug-c-code-in-visual-studio-code