无法打开包含文件:'stdio.h':没有这样的文件或目录

问题描述 投票:0回答:1

我是C++新手,遇到了以下困难。我已经安装了 Visual Studio Community 2022 版本 17.9.6,在其中我安装了屏幕截图中显示的项目。

enter image description here

在用 C++ 创建 Windows 控制台应用程序后,我在控制台中遇到了很多与导入“ctype.h”、“errno.h”、“float.h”等文件相关的错误。我开始寻找解决方案,但没有一个对我有帮助。

我尝试过的一些:

  • 将属性→常规→Windows SDK版本更改为10(我默认选择10.0)
  • 安装“Windows Universal CRT SDK”Visual Studio组件

我将非常感谢您的帮助!

P.S

C++部分的截图 enter image description here

我正在使用的代码

#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
}
c++ visual-studio
1个回答
0
投票

从截图来看: SDK 10.0.22621.0 已安装。

选择版本 10.0.22621.0 而不是默认的 10。

此外,请尝试修复 Visual Studio 并重新启动计算机。

© www.soinside.com 2019 - 2024. All rights reserved.