C++ code won't build (cannot open include file 'windows.h')

When building a new project, I get a build error on basic include files (windows.h, new).

I am using VS2013, on Windows 8 Pro x64. I can build non-Unreal projects using these headers but no C++ project will build if generated by Unreal Engine. This is an Unreal issue.

The generated project file seems wrong : in the directories menu of the project setup, all directories are empty.
I have tried reinstalling Visual Studio, repairing the Unreal installation, restarting, deleting temporay data and application settings, recreating the project.

I remember encountering this, or something similar, a while back on a test windows 8 machine. I don’t recall the specific steps I took to fix the issue, but its worth trying to install the Windows SDK 8.1 if you don’t already have it installed, in the meantime before staff or somebody else can get back to you, and see if that resolves it. It’s possibly also worth attaching the malformed project file to your post to assist with troubleshooting.

Installing the Windows 8.1 SDK does not fix the issue. Here is the project file.

Update :

  • Reinstalling the engine does not fix the issue
  • Reinstalling 8.1 SDK does not either
  • The same error is yielded on UnrealHeaderTool when building from source

Bumped. Still can’t build any Unreal project.

Temporary workaround for the bug :

  • Generate the project
  • In the VS project settings, go to Directories and use the “inherit” setting everywhere

This has to be done very time code is added, so a proper fix is still required.

Additional info :

  • In-editor compilation yields the same error messages
  • Blueprint compilation is unnaffected

Operations tried so far :

  • Reinstalled Windows 8.1 SDK
  • Removed previous versions of Visual Studio
  • Reinstalled Visual Studio 2013
  • Reinstalled Visual Studio 2013 redistributables (x86 and x64)
  • Reinstalled Unreal entirely
  • Checked environment variable VS120COMNTOOLS

Working fix for building in Visual Studio is to use the “inherit” settings, but this won’t work in editor and has to be done at each code add.

Similar issue : Cannot open include file 'windows.h' - C++ - Unreal Engine Forums

Is there feedback and support from Epic Games here or is this purely a community wiki ? How can I get effective feedback ? This is a blocking issue that had me working for two days now. I really wish this was fixed.

FIX : don’t use ‘special’ chars in your Windows account name. This will prevent UAT from harvesting the environment variables from the MSVS scripts, thus tricking it into believing that no compiler is available.

I changed my windows username from to , but it didnt fix anything for me…

I created a new account “Seb” (previously “Sébastien”) and this solved the issue!

@sillydan you cannot only rename your account, you have to get a new User folder without special chars

The inherit solution worked for me - also had tried all the things you listed off first. My name has no special characters so I don’t know what the actual solution here is supposed to be - it seems like Epic forgot to set the include directories when they built the project templates.

I am still getting same error in 2016.