c - Microsoft C++ 编译器, fatal error C1083 : Cannot open include file 'stdio.h'

标签 c visual-studio-2017

我有以下 C 文件。

#include <stdio.h>

我打开 VS 2017 的开发人员命令提示符实例并键入命令。

cl [my-file.c]

我收到以下错误消息

fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory.

我不确定如何解决这个问题。

最佳答案

当前 session 的包含目录存储在 INCLUDE 中环境变量。

您可以通过输入 echo %INCLUDE% 查看此内容在命令提示符下。

要将目录添加到包含路径,请使用命令 set INCLUDE=%INCLUDE%;C:\foo\bar .

事实上,编译器没有找到像 <stdio.h> 这样的标准且普遍存在的 header 。表明您的 Visual Studio 安装存在严重问题。如果我是你,我会运行修复安装。

关于c - Microsoft C++ 编译器, fatal error C1083 : Cannot open include file 'stdio.h' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54184448/

相关文章:

c - C 中的 strcmp 返回 1 而不是 0

c# - 快速信息不显示某些项目可能存在的异常

cordova - 如何在 Visual Studio 2017 中使用更新的 Cordova 插件

C - 如何打印动态数组?

c - 共享库构造函数不工作

c - 写入/dev/input/mice 不能模拟鼠标点击

c - C 中的按位连接

visual-studio-2017 - Productivity Power Tools 的功能 "remove and sort usings on save"在 VS2017 中不起作用

c# - 是否可以将 xaml.cs 连接到 VS2017 csproj 格式的相应 xaml?

visual-studio - 为什么我会从 Visual Studio 收到一个带有 "You must rename an identifier"的错误对话框?