I face problem with configuring launch.json file on my Windows and it shows error message
Debug adapter process has terminated unexpectedly.
I have set up "MinGW" and configured g++ compiler, and now Visual Studio Code compiles correctly. When I press Ctrl+Shift+B, it creates a.exe file in project folder.
My launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false
},
{
"name": "C++ Attach (Windows)",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command.pickProcess}"
}
]
}
My task.json file:
{
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"showOutput": "always",
"args": ["-std=c++11","-g", "main.cpp"]
}