visual-studio-code - vscode配置c/c++怎么让编译之后立刻运行?
本文介绍了visual-studio-code - vscode配置c/c++怎么让编译之后立刻运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
只是想编译之后立刻运行,像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"
}
]
}
为啥,第二个任务不会运行。。
解决方案
现在VS Code的任务是不会连续执行的。
解决方法:
利用外部工具,例如写脚本、msbuild、make等等
配置调试,不加断点,编译后再按F5运行
2017-03-02更新:
VS Code 1.10支持组合多个任务了,也可以给单个任务设快捷键。
这篇关于visual-studio-code - vscode配置c/c++怎么让编译之后立刻运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文