So, when i try to debug a simple program in VS Code i get the following message: "The preLaunchTask 'g++.exe build active file' terminated with exit code 1" and get 3 options to choose: Cancel, Debug anyway and show errors. By choosing show errors, it shows me that i dont have any. By choosing Debug anyway i get this message: "Unable to start debugging. Unexpected GDB output for command " - enviroment - cd (the directory of the file). (the directory of the file): No such file or directory.
So, i assume that im not in the right directory, but ive checked and done multiple tries if im not correct, but i think that im in the right directory. So, another thing i assume is that if the debugger makes another file and it is in other directory, so that doesnt exist in the current one and cant start debugging. Can you tell me where i am wrong and suggest me any solutions? Thank you!
https://prnt.sc/r95nl7https://prnt.sc/r95oik
Thats all i get as messages and the .json file. And im currently rewriting the code to find my mistake, because i can not debug it. Also, i dont have nothing in the enviroment in the .json file, because ive read that there should be. Should i have something or i am wrong?
Here is the .json file:
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\G++ compiler\\mingw32\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++.exe build active file"
}
]
}