How does one set up the Visual Studio Code compiler/debugger to GCC?

前端 未结 7 545
野趣味
野趣味 2020-12-13 17:56

I am programming in C in Visual Studio Code, but I can\'t compile, as VSC only offers three compilers built in - Node.js, C# Mono, and Extension development. After a little

7条回答
  •  难免孤独
    2020-12-13 18:27

    Just wanted to add that if you want to debug stuff, you should compile with debug information before you debug, otherwise the debugger won't work. So, in g++ you need to do g++ -g source.cpp. The -g flag means that the compiler will insert debugging information into your executable, so that you can run gdb on it.

提交回复
热议问题