这篇博客介绍了如何在Visual Studio Code中配置g++.exe编译器和GDB调试器,通过launch.json和tasks.json文件设置,实现C++程序的编译与调试。配置包括指定编译路径、调试器路径、启动命令以及预编译任务。
摘要由CSDN通过智能技术生成
launch.json
{"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":"${workspaceFolder}","environment":[],"externalConsole":true,//让其弹出终端"MIMode":"gdb","miDebuggerPath":"D:\\mingw64\\bin\\gdb.exe","setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":true}],"preLaunchTask":"task g++"}]}