Windows Kits errors preventing build

Just a couple of days ago I was able to build for 4.4 and 4.5 successfully, but now I get over 100 errors regarding Windows Kits which prevents me from building. I haven’t changed anything, so I don’t know why it suddenly has stopped working. I think it’s more likely it has to do with VS or the environment somehow, rather than UE4 itself, as it started to happen with both 4.4 and 4.5 at the same time, but I don’t know what could possibly be wrong, so I’m hoping someone with more experience in VS here has a potential solution. Until then, I’m locked out of my project.

I have tried both versions 4.4.3 and 4.5.1, with configurations for development_editor (x64), development (x64) and shipping (win32), and I get the same thing for them all. Double clicking an .uproject and letting it rebuild from there gives the same error.

my C:\Program Files (x86)\Windows Kits\8.1 is 555mb and has plenty of files in it.

Using the pre-compiled engine versions and Visual Studio Ultimate 2013.

Here’s the full error from VS:

Tried installing version 4.6.0 preview and creating a new project. Still the same thing.

The Unreal Engine does not support windows types somehow. You can wrapp your #include windows.h, or something similar you may have, with

 #include "AllowWindowsPlatformTypes.h"
  #include "yourwindowstypes.h"
  #include "HideWindowsPlatformTypes.h"

Please try this and reply if I am wrong.

1 Like

Thanks, but I’m not aware that I’m including windows.h anywhere. This issue happens with a completely blank project.

Also tried downloading windows kits 8.1 anew and performing a repair of visual studio, but to no success.

My WindowsKits/8.1 folder has 444MB,
I renamed the WindowsKits folder and tried to build the first person template C++ Verion with visual studio. Plenty of errors poped. So it is needed by the engine.
My best guess is: Your WindowsKits version8.1 (which was missing in my try) is corrupted in any way. I would rename the WindowsKits folder and run the visual studio repair again and look if the folder is restored. reinstall all dependencies.

I renamed the 8.1 folder and ran the VS repair as you said. The new 8.1 folder was only 80mb in size, and when I tried to compile, it said it was missing windows.h, which it was trying to include in the engine code in a file called MinWindows.h.

So I merged the 80mb large 8.1 folder into the 555mb large one, and put that back, but now I’m back at square one with the old error.

Would you mind posting your user and system PATH variable? The only thing I can think of is that some program has changed it, and now it can’t find windows kits correctly because of that.

Paths work fine for me when i let the editor refresh the sln file. To do so open the uproject file with your editor. Click File → Refresh Visual Studio Project. I do this always when I pull the latest version of the project from the Repository. That makes sure that your paths are correct.

What variables do you mean? user and system path? where to find?

I deleted the .sln, .sdf and .suo files, and rightclicked the .uproject and chose Generate Visual Studio project files (can’t access the editor as it tells me it’s out of date and wants to recompile (which doesn’t work)), however, it didn’t help.

Nevermind about the path, I realized it’s probably not a problem with the paths. If I move the 8.1 folder I get a different error saying that it cannot find the include windows.h, so it would seem that it does find the windows kits files for me, but… well, I don’t know. I don’t understand how it could read the files wrong and come up with all those syntax errors. It’s almost like if one is x64 and the other is x86. But both VS and windows kits are under Program Files (x86), and it has worked before so I don’t know why it would change.

Alright! After trying just about everything, I finally found the solution. If anyone else encounters this problem, this is what I did:

I simply had to copy the files in Windows Kits/8.0/Include into Windows Kits/8.1/Include, replacing all the conflicting files. I’m sure this is very not-recommended, but atleast now it works, and I can tell no difference otherwise, so I’m happy.

these includes works to me :smiley:

Thanks very much @Maxxomatik , you are a lifesaver! I had these crazy UNICODE errors like

G:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\PakFile\Public\IPlatformFilePak.h(2654): error C3668: ‘FPakPlatformFile::CreateDirectoryW’: method with override specifier ‘override’ did not override any base class methods

and clamping IPlatformFilePak.h inside these Allow… and HideWindowsPlatformTypes fixed it

#include "Windows/AllowWindowsPlatformTypes.h"
#include "IPlatformFilePak.h"
#include "Windows/HideWindowsPlatformTypes.h"
1 Like