【发布时间】:2020-09-24 12:14:11
【问题描述】:
所以我正在尝试在 VS Code 中设置 C/C++。 我安装了 mingw,VSCode 和 Code Runner 中的 C/C++ 扩展 Code Runner 开启了以下设置: RunInTerminal
这是我尝试运行的代码:
#include<stdio.h>
int main()
{
int age;
printf("Enter age\n");
scanf("%d", &age);
printf("Age is %d", age);
return 0;
}
当我点击 Code-Runner 中的运行按钮时,终端会生成以下输出:
$ cd "c:\Users\alexa\Desktop\Projekte\C\" && g++ test.cpp -o test && "c:\Users\alexa\Desktop\Projekte\C\"test
bash: cd: c:\Users\alexa\Desktop\Projekte\C" && g++ test.cpp -o test && c:UsersalexaDesktopProjekteC"test: No such file or directory
我知道问题在于 bash 中使用的路径中缺少反斜杠
c:UsersalexaDesktopProjekteC"测试
但我找不到修复它的方法。 我在 Windows 10 上
【问题讨论】:
-
似乎是一个已知的问题,bash 刚刚改回 windows cmd 并且可以正常工作
标签: c++ c visual-studio-code vscode-code-runner