I'm trying to set up a OpenGL environment in vs code, I'm using MinGW64 with msys for compilation and package management, I wrote a tasks and launch json files for generating builds, but when I run the build that was generated I get an error stating "unable to establish connection to GDB" and my app aborts.
this is my launch.json:
"version": "0.2.0",
"configurations":
[
{
"name": "Lauch OpenGL App",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Build OpenGL App",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\Build\\app",
"stopAtEntry": false,
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands":
[
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
This is my tasks.json:
{
"tasks":
[
{
"label": "Compile source code",
"type": "shell",
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
"args":
[
"-c",
"main.cpp",
"-o",
"Build\\Temp\\main.o"
]
},
{
"label": "Link Libraries",
"type": "shell",
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
"args":
[
"-o",
"Build\\app",
"Build\\Temp\\main.o",
"-L.",
"-lglfw3",
"-lopengl32",
"-lgdi32"
]
},
{
"label": "Cleanup",
"type": "shell",
"command": "Remove-Item",
"args":
[
"Build\\Temp\\*.*"
]
},
{
"label": "Build OpenGL App",
"dependsOrder": "sequence",
"dependsOn": ["Compile source code", "Link Libraries", "Cleanup"]
}
],
"version": "2.0.0"
}
When I run my build tasks everything works until the moment the app launches then the following error is shown:
And this is printed to the console: