使用cygwin的Visual Studio代码(不工作)
问题描述:
我刚刚安装了VSCode(在Windows上),并且我正在尝试使用cygwin运行C编译器。我关注此页面:https://code.visualstudio.com/docs/languages/cpp。我的c_cpp_properites.json
和launch.json
文件很好。我认为这是我的tasks.json
文件问题:使用cygwin的Visual Studio代码(不工作)
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "Build test",
"type": "shell",
"command": "g++",
"args": [
"-g",
"test.c"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
]
}
我只是想运行一个simple Hello World program。任务运行,如终端所示:
执行任务:g ++ -g test.c <终端将被任务重用,按任意键关闭它。
并没有什么东西显示在输出端。我可以从cmd运行a.exe
文件,它可以工作,但我宁愿将输出打印在VSCode中。