简体   繁体   English

为什么 Visual Studio Code 无法编译我的 C 代码?

[英]Why Visual Studio Code can't compile my C code?

I have a problem which is: VSC can't compile my C code as the title said.我有一个问题是:VSC 无法编译我的 C 代码,如标题所述。 I have looked for the problems and did all what was necessary:我一直在寻找问题并做了所有必要的事情:

  • installed msys安装了 msys
  • installed mingw安装了mingw
  • installed C/C++ extensions安装的 C/C++ 扩展
  • added code runner添加了代码运行器

Yet the problem is still showing like this:然而问题仍然是这样的:

gcc.exe: error: name.c: No such file or directory

(Note that I'm an absolute beginner when it comes to using VSC and don't have any background in coding so I'd appreciate it if I get to know the solution by simple vocabulary:) ) (请注意,在使用 VSC 时,我是一个绝对的初学者,并且没有任何编码背景,所以如果我通过简单的词汇了解解决方案,我将不胜感激:))

It seems like your c file('name.c') is not located in your working directory.您的 c 文件('name.c')似乎不在您的工作目录中。

Moving your c file to your project folder may solve your problem.将 c 文件移动到项目文件夹可能会解决您的问题。

To check your working directory, choose terminal tab and type 'pwd'.要检查您的工作目录,请选择终端选项卡并输入“pwd”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM