【问题标题】:How to compile and run cpp file using g++ in Visual Studio Code?如何在 Visual Studio Code 中使用 g++ 编译和运行 cpp 文件?
【发布时间】:2015-07-11 03:44:56
【问题描述】:

我正在尝试使用一个任务,但只能找到如何编译:

{
    "version": "0.1.0", 
    "command": "g++",
    "args": ["-Wall", "${file}"],
    "showOutput": "always"
}

我还想在程序运行时将输入/输出打印到控制台。

【问题讨论】:

标签: c++ g++ visual-studio-code


【解决方案1】:

你可能想看看https://code.visualstudio.com/Docs/tasks

最后有一个示例如何设置任务系统以使用 gcc。如果您有多个文件要编译,您可能需要考虑使用 make 文件并直接调用 make 而不是 gcc。

【讨论】:

    猜你喜欢
    • 2020-08-23
    • 2020-09-04
    • 2021-12-19
    • 1970-01-01
    • 1970-01-01
    • 2020-01-21
    • 1970-01-01
    • 2019-01-14
    • 2018-03-10
    相关资源
    最近更新 更多