如何将 Visual Studio Code 编译器/调试器设置为 GCC? [英] How does one set up the Visual Studio Code compiler/debugger to GCC?
问题描述
我在 Visual Studio Code 中使用 C 进行编程,但我无法编译,因为 VSC 仅提供三种内置编译器 - Node.js、C# Mono 和扩展开发.经过一番挖掘,我发现了 Visual Studio Marketplace.这似乎是正确的事情,但那里只有四种不常见的语言.
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 bit of digging I came across the Visual Studio Marketplace. This seemed like the right sort of thing, but only four uncommon languages were there.
我只能假设内置了 C 调试支持,我就是找不到它,或者我的做法是错误的.我尝试创建一个新的 launch.json(似乎包含每个文件的编译/调试设置的清单)并手动输入我拥有的 GCC 二进制文件,但最终没有成功.我目前无法通过命令提示符手动编译我正在处理的 C 源文件.
I can only assume that C debugging support is built in, I just can't find it or I am going the wrong way about doing it. I attempted to create a new launch.json (the manifest that seems to hold the compiling/debugging settings for each file) and manually entering the GCC binaries that I have, but that didn't end up working. I'm currently stuck manually compiling the C source file I am working on through command prompt.
如果有人可以为我指明正确的方向,那真的很有帮助.
Would really help if someone could point me in the right direction on what to do.
tl;dr - 任何人在 Visual Studio Code 中调试 C 的帮助
Windows 8,如果这很重要
干杯!
推荐答案
按 Ctrl + Shift + P 拉起 命令面板,然后键入ext install cpptools
.它将安装调试 C 和 C++ 所需的一切.
Press Ctrl + Shift + P to pull up the Command Pallette, and Type ext install cpptools
. It will install everything you need to debug C and C++.
在VS代码中调试很完整,但如果只需要编译运行:
Debugging in VS code is very complete, but if you just need to compile and run:
https://code.visualstudio.com/docs/languages/cpp
查看调试部分,它会解释一切.
Look in the debugging section, and it will explain everything.
这篇关于如何将 Visual Studio Code 编译器/调试器设置为 GCC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!