c++ - 微软 Visual Studio 社区 2019 : fatal error C1083: Cannot open include file: 'corecrt.h' : No such file or directory

标签 c++ visual-studio

刚刚完成 Microsoft Visual Studio Community 2019 的全新安装,没有可选功能, enter image description here 尝试使用 C++ 控制台应用程序项目类型运行简单代码:

#include <iostream>

using namespace std;

int main()
{
    cout << "testing vs 2019" << endl;
    return 0;
}

出现以下错误:

1>------ 全部开始重建:项目:Project1,配置:调试 x64 ------ 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(434,5):警告 MSB8003:未定义 WindowsSDKDir 属性。可能找不到某些构建工具。

1>源.cpp 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\crtdefs.h(10,10): fatal error C1083: 无法打开包含文件: ' corecrt.h': 没有那个文件或目录 1> 完成构建项目“Project1.vcxproj”——失败。 ==========全部重建:0个成功,1个失败,0个跳过==========

最佳答案

我建议您应该在VS2019安装程序中下载并安装Windows 10 SDK。

enter image description here

选择的版本需要和项目中设置的版本一致。

enter image description here

关于c++ - 微软 Visual Studio 社区 2019 : fatal error C1083: Cannot open include file: 'corecrt.h' : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58946328/

相关文章:

c++ - boost & g++ : no matching function for call to 'current_path()'

C++ 使用模板将函数指针传递给函数

c++ - VxWorks 中的成员函数指针

c++ - 修改默认的 Visual C++ 项模板

c++ - 为什么缓冲区获得垃圾值?

visual-studio - Visual Studio 中的 Azure Service Fabric - hresult : 0x80131500

javascript - Visual Studio ReSharper - 在外部模块中声明的 Typescript 自动导入类 - 使用 from 而不是 require

c++ - 为什么这个函数对负数不起作用?

android - Visual Studio无法为Flutter应用程序创建模拟器

C++ 根据字符串计算年龄