0

I use VS2017 to build some c++ projects and it goes successfully. When I build some libraries with MSBuild, cl or qt-creator with msvc tools , there are always errors of "can not open include file",and these missing include files all locate in Windows Kit, such as:

e:\workspace\boost_1_70_0\tools\build\src\engine\jam.h(71): fatal error C1083: can not open include file: "ctype.h": No such file or directory
e:\workspace\boost_1_70_0\tools\build\src\engine\strings.h(11): fatal error C1083: can not open include file: "stddef.h": No such file or directory
order.c
e:\workspace\boost_1_70_0\tools\build\src\engine\modules\../mem.h(67): fatal error C1083: can not open include file: "stdlib.h": No such file or directory

I have searched for solutions and finally find one for qt: when I add the following two lines, qt-creator with msvc tools can build successfully:

win32 {
    INCLUDEPATH += "F:\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt\\"
    LIBS += -L"F:\\Windows Kits\\10\\Lib\\10.0.17763.0\\ucrt\\x86\\"
}

and for this, I have checked user.props:

<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>

It is obviously that something went wrong with WindowsSDKVersion, WindowsSDK_IncludesPath, WindowsSDK_LibraryPath or something else about Windows SDK. But this prombles dosen't exist until this year. I have no ideal what happend.

Is there any way to correct WindowsSDK_IncludesPathand WindowsSDK_LibraryPath, or at least make it possible to use msbuild and cl?

DWCarrot
  • 31
  • 2
  • This doesn't have anything to do with the SDK. The CRT got split in two in 2015, intention was to give UWP programs their own copy of the CRT, distributed by Windows Update. Why your qt-creator copy doesn't know this is unguessable, maybe it is old and you'll have to update it. – Hans Passant May 03 '19 at 17:51
  • Sorry I am a bit confused...but when I use VS2017(GUI) nothing goes wrong. And it seems that if I want to update CRT I need to update windows?(The windows update works well) – DWCarrot May 04 '19 at 03:46

1 Answers1

0

Well...I find a "dirty" solution finally: I edit the vcvarsall.bat, change the default value of __VCVARSALL_WINSDK to my target WindowsSDK version: enter image description here (%WindowsSDKVersion% is an environment variable I set before)

It seems that everything works well...hope so

DWCarrot
  • 31
  • 2