Reputation: 3
Following the documentation provided by VSCode for C++ provided on this link: https://code.visualstudio.com/docs/languages/cpp, I ran into trouble when checking the MinGW installation. When I ran gdb --version I got this:
$ gdb --version
-bash: gdb: command not found
Upvotes: 0
Views: 8350
Reputation: 1
I would like to add some details for newbies like me: if your gcc and g++ version work properly but gdb not - write "pacman -S mingw-w64-x86_64-gdb" in msys2 ucrt64, it should download the missing parts(for some reason it took me 2 tries to download full) then you should go to Path and add address for gbd separately form gcc, it should look like: C:\msys64\mingw64\bin and C:\msys64\ucrt64\bin. Then, I guess, it would work just fine, I mean, finally gbd --version worked for me.
Upvotes: 0
Reputation: 807
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
You should add the same Installation Folder used in step 3 of installation instruction to the system PATH variable or if you have used installer to install the MinGW find the MinGW installation directory by opening your C drive and add that path to system PATH (in my case Ex: C:\msys64\mingw64\bin)
Make sure the C:\msys64\mingw64\bin is not empty, if it's empty mostly you haven't continued from the step 5 after installing MYSYS from installer
After adding system PATH, close and open cmd window just type path in cmd and enter to make sure your MinGW path is addedd to system PATH, (you can copy paste the output to notepad/notepad++ and search MinGW to find the path)
Once MinGW is in the path your gdb command should work (please provide this screenshot of path command output, if it's still didn't work)
Upvotes: 1