如何在Visual Studio Code(最新版本)中创建任务以编译和运行.c文件。
我在网上找到了这个:
"version": "2.0.0",
"tasks": [
{
"label": "compile and run C",
"type": "shell",
"command": "(gcc -g ${file} -o ${fileBasenameNoExtension}) -and (./${fileBasenameNoExtension})",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
我设法对其进行了调整,但是它仍然无法同时编译和运行,而是得到了:
> Executing task: (gcc -g d:\ISEP\ARQCP\partilha\arqcp19202deg01\pl0_7.c -o pl0_7) -and (./pl0_7) <
False
Terminal will be reused by tasks, press any key to close it.
有什么方法可以使用简单的快捷方式来编译和运行我的代码(当前,我按CTRL + SHIFT + B可以“编译并运行”)?
因此,我一直在寻找一种实现方法,并且找到了这个简单的扩展:Code Runner。
基本上,它只是为大多数编码语言添加了一个“运行代码”按钮,因此非常容易。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句