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

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

问题描述

我刚刚在使用Windows 10的工作笔记本电脑上安装了Visual Studio 2015.

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

我克隆了一个存储库,其中包含使用相同版本的Visual创建的解决方案Studio(更新3)在另一台PC上,总是使用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.0\vc\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory

在< a href =https://social.msdn.microsoft.com/Forums/vstudio/en-US/86bc577b-528c-469c-a506-15383a44c111/missing-corecrth-from-the-default-include-folder-for- vs215?forum = vcgeneral>这个页面我读过我必须将 $(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)参考s到这条路径:

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

C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt

笔记本电脑上缺少此路径。相反,我就是这个:

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

C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt

所以看起来窗口版本不同。可能这是真的,因为在我的笔记本电脑上我没有安装1511 windows updgrade,而在另一台电脑上都安装正确。

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.

- EDIT

我注意到我有这条路径:

I've noticed that that I have this path:

C:\Program Files (x86)\Windows Kits\8.1\Include\10.0.10240.0\ucrt

It具有相同的 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 Universal CRT SDK。

  6. 安装。

  1. Run Visual Studio Installer.
  2. Select Modify button.
  3. Go to "Individual Components" tab.
  4. Scroll down to "Compilers, build tools and runtimes".
  5. Tick "Windows Universal CRT SDK".
  6. Install.

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

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