I have a small vcxproj. It is 64-bit only, uses v141 platform toolset, and was using Windows SDK 8.1, I have also tried using Windows SDK 10.0.16299.0 to see if that made any difference, but it didn't.
Previously, the project was being compiled using 32-bit MSBuild, and working fine. Recently I tried compiling using 64-bit MSBuild. The command line call to the C++ compiler is identical (including all include directories), apart from the compiler it calls is
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\CL.exe
instead of
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64\CL.exe"
(changed HostX86 -> Hostx64). This results in the following error message:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\crtdefs.h(10, 0): error C1083: Cannot open include file: 'corecrt.h': No such file or directory
I am at a loss as to what the problem could be; it's using the same include paths, and the same Windows SDK. I don't see why the bitness of the compiler should affect whether it can find a header file when the target architecture hasn't changed!
The machine this is running on has Visual Studio 2017 Enterprise, Windows SDK 8.1 and Windows SDK 10.0.16299.0 installed.
Slightly wider context: this came up as part of updating our build dependencies. We use Invoke-Build to run the build, and as of 3.6.3 it started detecting 64-bit MSBuild installations, and using them by default. I could, of course, simply pin to 32-bit MSBuild, but I would like to get to the bottom of why the bitness of the build tools makes a difference in this situation.