visual studio code wsl gcc compiler path code example
Example 1: setup vscode for wsl ubuntu c
sudo apt-get install build-essential gdb
Example 2: how to run cpp using gcc vscode
{
"version": "0.1.0",
"command": "make",
"isShellCommand": true,
"tasks": [
{
"taskName": "Makefile",
"isBuildCommand": true,
"showOutput": "always",
"args": ["all"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}