So opening the project in Visual Studio 2015 constantly gives an error that the project was not able to compile due to corecrt.h file not being found. This also happens when I try to compile UE4 project.
After some research, I found a way to fix the issue. I have to select the project in the Solution Explorer, then go to Project > Properties > VC++ Directories and add the following paths to Include Directories and Library Directories respectively:
After doing this, right-click the project and select “Clean” and then “Build”.
After doing the steps above, everything builds and runs perfectly.
Here’s the Microsoft announcement about these changes:
My questions is if I’m missing some package when I installed Visual Studio 2015 or is UnrealEngine missing these include/library paths once it’s created?
Important note: I’m using Windows 10 and I don’t have any previous version of Visual Studio on my system.
This also affects Hot Reloading, which gives the same compiler error but I was unable to figure out how to get the include and lib path into the Unreal Build Tool,
The include paths that you are referring to should be inherited by the project in Visual Studio. If you select either the Include or Library fields and click the drop-down arrow and select Edit, the window that appears should have a checkbox labeled “Inherit from parent or project defaults”. Is that checked? If so, the Inherited Values section should include one or more macros. If you click the “Macros> >” button, it will show you a list of all of the available macros, and the paths that they contain. Check to make sure the macros that are shown in the Inherited Values section contain the path in the macros you listed above. In my case, the $(VC_IncludePath) macro contained the $(UniversalCRT_IncludePath) path, and $(VC_LibraryPath_x64) macro contained the $(UniversalCRT_LibraryPath_x64) path.
If I check that option it works (but not hot reloads). Shouldn’t that be included by default? Why was it empty when I opened (and thus giving the compiler error)? Also, even if it compiles correctly, the UBT will still give me the same error on Hot Reloads, basically, whatever I changed in my include paths and lib paths are not being picked up by UBT. I believe UBT gets that from env variables?
Actually, never mind, UBT is actually just getting the version there. I’m still concerned though why UBT is not picking up the includes and lib when I compile the game from the editor.
With Windows Driver Kit installed, the include and lib directories of Windows Kits had more than one directory inside (wdf + a bunch of others) in C:\Program Files (x86)\Windows Kits\10\include AND C:\Program Files (x86)\Windows Kits\10\Lib and Unreal Build Tool was using the wrong directory.
To solve this issue, I just uninstalled Windows Driver Kit and now everything works. I suggest, though, a fix in the logic of Unreal Build Tool in case someone has the same problem I had and cannot uninstall Windows Driver Kit.
Thank you for the additional investigation that you performed for this issue. I am not sure I would have made the connection with Windows Driver Kit since I don’t have that installed. I have entered a ticket to have this situation investigated further (UE-22632).
I am looking at this issue and you have provided references to code in our Main branch which is not part of the 4.10 branch and the preview. Are you pulling Master directly? Or did this happen from 4.10 pull?
Ok, so unfortunately, we won’t be able to get a fix for 4.10 because we are still calling the vcvars.bat to generate the environment variables and trying to change that at this late of a date is just not feasible. I am working on a fix for master and 4.11 where we are trying to remove the need for that in the first place.
Just integrated 4.11.2 and hit this issue. I’ve had a combination of WDK and SDK versions installed, after removing the WDK it still cannot find corecrt.h
Update:
So I’ve had to explicitly do a rebuild on the project for this to work, despite not having built the code before. A clean then build on the project does not have the same effect as a rebuild
Im using UnrealEngine 4.12.5 and i have this issue, i removed WDK but still get the error (even after rebuild in VS), but i notice i had 3 version of SDK: 10.0.10586.212, 10.0.14393.33, 10.0.26624. Should i remove the older version? (Im on Windows 10, version 1607, and i have same error as quinx).
There should be no problem with removing the older versions of the SDK, but there should also be no problem with leaving them there. Could you please try deleting the Intermediate folder in your Engine source code, then run GenerateProjectFiles.bat and build the Engine again?