Skip to content

Instantly share code, notes, and snippets.

@lawvs
Last active October 18, 2020 12:35
Show Gist options
  • Save lawvs/5e8bd6620a35998244fbe48a7ba423ad to your computer and use it in GitHub Desktop.
Save lawvs/5e8bd6620a35998244fbe48a7ba423ad to your computer and use it in GitHub Desktop.
vscode c++ config
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "C++",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/.debug/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"preLaunchTask": "g++",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
{
"version": "2.0.0",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"isBackground": true,
"tasks": [
{
"type": "shell",
"label": "g++",
"command": "g++",
"group": {
"kind": "build",
"isDefault": true
},
"args": [
"-g",
"-Wall",
// "-O1",
"-std=c++17",
"${file}",
"-o",
"${workspaceRoot}/.debug/${fileBasenameNoExtension}.out"
],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment