visual-studio-code - vscode配置c/c++怎么让编译之后立刻运行?
高洛峰
高洛峰 2017-04-17 15:25:32
0
1
606

只是想编译之后立刻运行,像sublime那样从文件读入后输出到下面控制台。
写了个tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "tasks": [
        {
            "taskName": "build",
            "command": "g++",
            "isShellCommand": true,
            "args": [
                "-o",
                "${workspaceRoot}/main",
                "${workspaceRoot}/main.cpp"
            ],
            "showOutput": "always"
        },
        {
            "taskName": "run",
            "command": "${workspaceRoot}/main",
            "isShellCommand": true,
            "showOutput": "always"
        }
    ]
}

为啥,第二个任务不会运行。。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
Peter_Zhu

Now VS Code tasks will not be executed continuously.

Solution:

  1. Use external tools, such as scripting, msbuild, make, etc.

  2. Configure debugging without adding breakpoints. After compiling, press F5 to run

Updated on 2017-03-02:

VS Code 1.10 supports combining multiple tasks, and you can also set shortcut keys for a single task.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!