Skip to content

Instantly share code, notes, and snippets.

@huihut
Created June 12, 2018 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huihut/887d3c28db92617bd5148c20a5ff112a to your computer and use it in GitHub Desktop.
Save huihut/887d3c28db92617bd5148c20a5ff112a to your computer and use it in GitHub Desktop.
Configuring tasks.json for C/C++ debugging
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"windows": {
"command": "g++",
"args": [
"-ggdb",
"\"${file}\"",
"--std=c++11",
"-o",
"\"${fileDirname}\\${fileBasenameNoExtension}.exe\""
]
}
}
]
}
@IsmailBj
Copy link

hello friend im having an error when i start debugging Could not find the task 'g++ build active file'
i know its my problem not your code but what would i do i dont have experience with JSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment