I'm trying to run from a launch.json file, so i can use gdb to debug my program in vscode.
The launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "SourceFolder/test",
"args": [],
"stopAtEntry": false,
"cwd": "SourceFolder",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ compile active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
The path is correct, i can see the compiled file right there in the folder. I can run the program via console (bash) no problem and it doesn't throw any errors, but when i run it via this method i get the following pop up:
Unable to start debugging. Program path 'SourceFolder/test' is missing or invalid.
GDB failed with message: SourceFolder/test: File or directory not found.
...
And the debug-terminal returns:
The program 'SourceFolder/test' has exited with code 42 (0x0000002a).
Could "preLaunchTask": "g++ compile active file" be causing this error?