第一个lanuch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "F:\\mingw\\mingw64\\bin\\gdb.exe",//这个地方因人而异
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build hello",
}
]
}
第二个tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "build hello",
"command": "g++",
"args": [
"-g","hello.cpp",
],
"group": {
"kind": "build",
"isDefault": true,
}
}
]
}
第三个settings。josn
{
"files.autoGuessEncoding": true,
"C_Cpp.errorSquiggles": "Enabled",
"files.associations": {
"iostream": "cpp"
}
}