Cannot compile UnrealEngine 4.11.2

Hello Guys!

I have a problem. Yesterday i tried to add a new C++ class to one of my projects and compiling process failed for some reason. I tried to create a new basic C++ project it failed also at compiling. I started to browse the forums for a solution, but nothing worked so far. I tried to reinstall Visual Studio 2015 Community (i also have update 2), Unreal Engine. I checked the FAQ and did what it told me, it didnt help. I tried a lot of suggestions, i would say every suggestion what i could find, but nothing worked so far. I hope someone has a new idea because i’m stuck at the momment. Please help me. Thank you in advance.

Here is the error massage:

The project could not be compiled. Would you like to open it in Visual Studio?

Running C:/Program Files (x86)/Epic Games/4.11/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject Development Win64 -project=“C:/Documents/Unreal Projects/MyProject/MyProject.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE -2015
@progress push 5%
Parsing headers for MyProjectEditor
Running UnrealHeaderTool “C:\Users\Joni\Documents\Unreal Projects\MyProject\MyProject.uproject” “C:\Documents\Unreal Projects\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\UnrealHeaderTool.manifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 4,3270175 seconds
@progress pop
Performing 9 actions (2 in parallel)
[2/9] Resource PCLaunch.rc
C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\Launch\Resources\Windows\PCLaunch.rc(10) : fatal error RC1015: cannot open include file ‘windows.h’.
PCH.MyProject.h.cpp
[3/9] Resource ModuleVersionResource.rc.inl
C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\Core\Resources\Windows\ModuleVersionResource.rc.inl(3) : fatal error RC1015: cannot open include file ‘windows.h’.
c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Windows/MinWindows.h(62): fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: C:\Users\Joni\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
Total build time: 11,21 seconds

There is an error in the log you posted that seems unrelated to UE4.

fatal error RC1015: cannot open include file ‘windows.h’.

Be sure to look for these kinds of messages that you can google, this particular message gives loads of hits on google, with a lot of suggestions on what you can do to fix the problem.

Having said that, it seems like a complicated problem, and as of now I have a couple of suggestions for you:

  • Make sure you included C++ in your installation of visual studio 2015. You can check by going to programs and features. Select “Microsoft visual studio community 2015”, press change , press modify in the installer and look for C++ and hit install.
  • Some suggestions can be found here.
  • Some overlapping suggestions can be found here. (Note that this thread is from 2014, UE4 didn’t have support for vs2015, you shouldn’t need vs2013 like that thread states.

Hi Slabilo!

Thank you for your answer :slight_smile: I’ve already looked at the two links you posted and also googled the error massage. I tried the suggestions with no success unfortunately. For some reason it won’t compile even with the inherited options set properly.

Could you please navigate to C:\Program Files (x86)\Microsoft SDKs\Windows\ and perform a search in the folder where you see v7.0A (for example) , etc. Search for “include”

if no hits come up, you don’t have the windows sdk installed.

It is in: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A

Hello Guys!

I made progress i think, i copied the content of Include folder to C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\Launch\Resources\Windows and it solved the can not find windows.h, but unfortunately i still have problems. I will copy the new error massage below. I googled the warnings and the fatal error about linking but i didn’t find any good answers. I hope you can help. Thanks for the help in advance.

Parsing headers for MyProjectEditor
Running UnrealHeaderTool “C:\Users\Joni\Documents\Unreal Projects\MyProject\MyProject.uproject” “C:\Users\Joni\Documents\Unreal Projects\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\UnrealHeaderTool.manifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 11,6406815 seconds
@progress pop
Performing 9 actions (2 in parallel)
[2/9] Resource PCLaunch.rc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\sal.h(2886) : warning RC4005: ‘__useHeader’ : redefinition
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\sal.h(2896) : warning RC4005: ‘__on_failure’ : redefinition
[3/9] Resource ModuleVersionResource.rc.inl
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\sal.h(2886) : warning RC4005: ‘__useHeader’ : redefinition
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\sal.h(2896) : warning RC4005: ‘__on_failure’ : redefinition
PCH.MyProject.h.cpp
MyProject.generated.cpp
MyProjectGameMode.cpp
MyProjectPawn.cpp
MyProjectProjectile.cpp
MyProject.cpp
[9/9] Link UE4Editor-MyProject.dll
LINK : fatal error LNK1181: cannot open input file ‘wininet.lib’
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: C:\Users\Joni\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
Total build time: 223,07 seconds

I solved my problem. For some reason VS didn’t read in the necessary files from MicrosoftSDKs, so i had to manually copy them to the folders, where error log said they are missing.

You really shouldn’t copy those files over. Visual Studio should find them in the included directories. Something is preventing these files from being found by visual studio and/or ue4 including them.