I keep getting Unexpected GDB output from command "-exec-run"
error in the debug console while I try to run my c++ code which includes a custom class I made and takes a .txt file as an input in the same path.
I'm using the command g++ -g class.h class.cpp mycode.cpp -o mycode.exe
in the terminal and just try to debug the code with F5.
I don't get this error when I'm executing a cpp file with no libraries included
Here is my launch.json file
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}
I've heard downgrading gdb or g++ could help but I could not understand how can I downgrade them. If you think that's the solution a simple explanation for how to downgrade would be much appreciated.