Search code examples
c++debuggingvisual-studio-codemingwmsys

How to debug C++/C programs on VsCode


I am using the gcc/g++ compiler using msys64 and mingw64 with VsCode. I've attached the bash.exe of mingw64 to my VsCode terminal. I can run my programs on the bash terminal using g++ file_name.cpp && ./a.exe. But how do I debug my programs?


Solution

  • Actually debugging in VScode is a bit tricky. Have you followed the methods here-

    https://code.visualstudio.com/docs/cpp/cpp-debug