找不到 corecrt.h:$(UniversalCRT_IncludePath) 是错误的 [英] Cannot find corecrt.h: $(UniversalCRT_IncludePath) is wrong

查看:71
本文介绍了找不到 corecrt.h:$(UniversalCRT_IncludePath) 是错误的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在装有 Windows 10 的笔记本电脑上安装了 Visual Studio 2015.

I've just installed Visual Studio 2015 on my working laptop with Windows 10.

我已经在另一台 PC 上使用相同版本的 Visual Studio(更新 3)创建的解决方案克隆了一个存储库,始终使用 Windows 10.

I've cloned a repository with a solution created with the same version of Visual Studio (update 3) on another PC, always with windows 10.

当我尝试在笔记本电脑上构建解决方案时,出现以下错误:

When I try to build the solution on my laptop I obtain the following error:

c:program files (x86)microsoft visual studio 14.0vcincludecrtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory

此页面 我读过我必须将 $(UniversalCRT_IncludePath) 添加到我的包含路径中,但即使在这种情况下,我也获得了同样的错误.

In this page I've read that I must add $(UniversalCRT_IncludePath) to my include paths, but even in this case I obtain the same error.

我已经检查过,$(UniversalCRT_IncludePath) 指的是这个路径:

I've checked and $(UniversalCRT_IncludePath) refers to this path:

C:Program Files (x86)Windows Kits10Include10.0.10240.0ucrt

我的笔记本电脑上没有此路径.相反,我有这个:

This path is missing on my laptop. Instead I've this one:

C:Program Files (x86)Windows Kits10Include10.0.10150.0ucrt

看来window版本不一样了.可能确实如此,因为我的笔记本电脑上没有安装 1511 windows 升级,而在另一台电脑上则全部正确安装.

So it seems that window version is different. Probably this is true, because on my laptop I didn't installed the 1511 windows updgrade, while in the other pc is all installed correctly.

我的问题是如何在两台 PC 中都引用 corecrt.h 文件而不会弄乱路径.我想避免硬链接这些路径,因为它们依赖于 pc.我不明白为什么在我的笔记本电脑中路径是错误的,因为它应该依赖于系统而不是连接到解决方案中.

My question is how can I refer to corecrt.h file in both pc without make a mess with paths. I'd like to avoid to hard-link these path because they are pc dependent. and I don't understand why in my laptop the path is wrong considering that it should be system dependent and not cabled into solution.

我该如何解决这个问题?我知道我可以将我的笔记本电脑更新到相同的 Windows 版本,但出于多种原因我想避免它.

How can I solve this issue? I know that I can update my laptop to the same windows version but I'd like to avoid it for many reasons.

-- 编辑

我注意到我有这条路径:

I've noticed that that I have this path:

C:Program Files (x86)Windows Kits8.1Include10.0.10240.0ucrt

它具有相同的 10.0.10240.0 版本,但与另一个 Windows 套件版本相关,因此在这种情况下可能存在一些问题.在我的笔记本电脑上,我也有 Visual Studio 2013,所以也许它可以来自它,但我无法删除它,因为我正在使用 Visual Studio 2013 维护另一个项目,但我还不能删除它.

It has the same 10.0.10240.0 version but related to another windows kit version, so maybe there's some problem in this case. On my laptop I've also Visual Studio 2013, so maybe it can came from it, but I cannot remove it because I'm maintaining another project with Visual Studio 2013 and I cannot remove it yet.

也许在 Visual Studio 2015 文件夹中,我可以在某些 .bat 文件(vcvarsall.bat 或类似文件)中明确设置 $(UniversalCRT_IncludePath) 但我不知道哪个文件以及在哪个位置.

Maybe in Visual Studio 2015 folder I can set explicitly the $(UniversalCRT_IncludePath) in some .bat file (vcvarsall.bat or similiar) but I don't know which file and in which position.

推荐答案

对于 Visual Studio 2017,我必须:

For Visual Studio 2017 I had to:

  1. 运行 Visual Studio 安装程序.
  2. 选择修改按钮.
  3. 转到单个组件"标签.
  4. 向下滚动到编译器、构建工具和运行时".
  5. 勾选Windows 通用 CRT SDK".
  6. 安装.

这篇关于找不到 corecrt.h:$(UniversalCRT_IncludePath) 是错误的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆