Cannot find corecrt.h: $(UniversalCRT_IncludePath) is wrong

梦想与她 提交于 2019-11-27 18:27:39

For Visual Studio 2017 I had to:

  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.
Helge S

you probably fixed this already, but if someone else comes along, i solved this by following the tip here.

Basically set the following system environment variables:

INCLUDE="C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
LIB="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"

There is probably a much better best-practice way of doing it, but for just fixing it super-fast, this worked great.

user7869952

I had the same problem. I tried the answers here. It didn't work 100%. What I found is that the VC++ 2015 toolset (x86, x64) is necessary for the 2017 Community Edition (which I am using now), but without adding any include or lib links.

Best regards.

Try checking the projects properties (Menu Project > Properties). Under Configuration Properties > General, then check the Platform Toolset and Windows SDK Version (if using Platform Toolset > VS2015) After setting Platform Toolset = VS2017 and Windows SDK Version = 10.x.x it worked for me.

simondoo

Maybe there was something missing while installing the Visual Studio. You can check whether you forgot to choose the VC++ toolset.

  1. Control Panel -> All Control Panel Items -> Programs and Features -> Visual studio 2015
  2. Click change/uninstall
  3. Choose the VC++2015 toolset(x86,x64) and install.

For Visual Studio Community 2017 RC(15.0.26206.0), the name of optional tool is VC++ 2017 v141 toolset(x86,x64):

For me helps this setting in Visual Studio:

  • in Project properties -> VC++ Directories -> Include Directories -> open for edit.
  • check checkbox Inherit from parent or project defaults

For Visual Studio 2015 Enterprise, I solved the problem in a similar way as parsley72:

1. Run the Visual Studio Installer;
2. Select Modify button;
3. Go to "Windows and Web Development";
4. Tick "Universal Windows App Development Tools";
5. Install.

I just got this error while compiling PyTorch on Windows and installing Windows Universal CRT SDK didn't resolved it. After fiddling around it seems there are two causes:

  1. Make sure you run vcvarsall.bat. When you start VS2017 x64 Native Command Prompt, it does run this bat file.
  2. Set vcvars_ver to correct version that is on your machine. To find the version you have, go to %PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\. Inside this folder you will see folder such as 14.13.26128. So you set vcvars_ver to 14.13.

Below fragment in my batch file shows above two steps:

set "VS150COMNTOOLS=%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build"
call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.13

The reason of error could possibly could be because you don't have the updated version of windows 10 sdk

you can also download and install window 10 sdk autonomously,

using this link windows 10 sdk, and add it into your system path

hope it helps.

The Windows SDK you have selected in your project isn't installed.

Either install the SDK you want or select one of installed ones (note: selecting <inherit from parent> option will default to 8.1, which isn't installed by default in VS 2017+)

To install the Windows SDK, run the installer and go to Individual components and scroll to the very bottom:

Either add the older Windows SDK (ex. version 8.1 / Universal) to your machine (as described by parsley72), or re-target Project(s) to use one of the Windows SDK(s) installed on your computer.

I just ran into this with VS2017 and re-targeting worked. Though I'm still waiting for an answer on whether targeting a newer Windows SDK version has any ill effects.

I have no experience with VC++ but I have to build ta-lib for a python project. Since I do not want to touch anything in VC Studio but I have experienced with regular C programming under Unix, I have taken the approach of adding the include path directly in the Makefile; e.g.:

INCPATH = -I"..........\include" -I"..........\src\ta_common" -I"..........\src\ta_abstract" -I"..........\src\ta_abstract\tables" -I"..........\src\ta_abstract\frames" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"

There are multiple Makefiles under sub-directories so I have had to make changes to each one but it works alright for me.

I resolve this error by the next 3 step.

1) All file from:

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86

Copy to:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\lib\x86

2) All file from:

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64

Copy to:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\lib\x64

3) All File from:

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

Copy to:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\include

Then I rebuild my project and all work properly

Reinstall windows 10 sdk , if you missing windows sdk or if its content changed this error will popup, it happend to me after installing wdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!