I am trying to use VScode for c++ programming and I wanted to learn debugging. When in run and debug section I click the link create a launch.json file, it is created, but almost empty - particularly "configurations" are empty. It looks like this:
{
// 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": []
}
What do I need to do differently, or do I need to change some settings?
I remember before it created a launch.json file with some configuration, since then I changed compiler path to msys2/mingw64/bin/g++.exe, don't know if that may have caused the problem.
EDIT: I made it work by copy-pasting the right configuration somewhere from the internet:
{
"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:\\Program Files (x86)\\msys2\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
However the question still remains. I followed a tutorial. The steps are "create a launch.json file", then select an environment: C++ (GDB/LLDB), and then select a configuration (should be "g++.exe - build and debug active file") but it does not offer me this last option, why?