Problem creating code project, cannot find windows.h or open file new

So the past few days I’ve been trying to create a code project in UE4 so I can start getting into it. However, I keep getting the error about it not being able to find windows.h. Now I know that if I open it in visual studio and then change the #include directory etc to “inherit from project defaults” it will be able to build, but that isn’t a real fix.

I’m on Windows 8.1 and my IDE is visual studio 2013 Ultimate, I used to also have 2012 installed but I uninstalled it in case the two were conflicting some how. Going to the installation directory for the windows SDKs I have folders for 7.0A, 7.1A, 8.0, 8.0A, 8.1 and 8.1A. I’ve also installed the runtimes for direct X June 2010. Also my username has no accents or non-ascii characters (that can also mess it up)

All the solutions I’ve online solve it by installing windows SDK, visual studio 2013, direct X June 2010 or by changing the username. So now I’m fresh out of ideas and haven’t been able to find anything else to try online.

For completeness the error I get is below

Performing 7 actions (2 in parallel) [2/7] Resource ModuleVersionResource.rc.inl C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Core\Resources\Windows\ModuleVersionResource.rc.inl(3) : fatal error RC1015: cannot open include file 'windows.h'. PCH.SandboxProject.h.cpp [3/7] Resource PCLaunch.rc C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Launch\Resources\Windows\PCLaunch.rc(10) : fatal error RC1015: cannot open include file 'windows.h'. C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(5) : fatal error C1083: Cannot open include file: 'new': No such file or directory

EDIT: Viewing the visual studio project settings, for the android settings the empty include, source directories etc. are filled in with the path to the windows SDK and vc includes so it obviously knows where they are it just doesn’t fill it out for every build setting.

Hey xd009642-

Is this when building the engine from source code or when creating a new project? If you’re building the source version of the engine you may want to check that the correct dependencies are in place by running Setup.bat and GenerateProjectFiles.bat and build the engine solution in Visual Studio. When building the engine (or project) make sure that the solution configuration is DevelopmentEditor and the solution platform is Win64 for the initial build.

If you’re getting this error when creating a new project then you may want to check your anti-virus to make sure it’s not interfering. You can also check here for additional info on the errors that you’re getting (RC1015 and C1083). A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Cheers

Creating a new project and I got a prompt from windows firewall and clicked to allow UE to work on public and private networks so I wouldn’t expect that to be a problem. I’ve also checked that page and my VS120COMNTOOLS is correct, I have VS2013 ultimate so the issues with express aren’t valid and the other things I’ve tried.

I’m not sure if I installed 4.8 after uninstalling VS2012, but if not I may reinstall and see if that sorts it, however looking at the help I’d expect to be able to apply any of those fixes and have it work without reinstalling.

The “inherit from project defaults” fix also doesn’t work as when I add a new code file in the editor after applying the fix when it autocompiles it reverts the VS settings back to the defaults which cause RC1015 etc to be thrown. Personally I’m not sure why UE4 needs to reset the project settings when autocompiling, why not keep them the same? I can see that potentially causing issues if I wanted to integrate a third party c++ library…

I still haven’t found a way to fix this, and looking at the bug reports unanswered section I’m now on the third page (50 questions per page). I might play around with unreal further doing a blueprints project but the reason I moved to it from unity was because of the ability to actually get down deeper into code.

I’ve tried everything that I’ve found on the answerhub and elsewhere on the internet and nothing, I’ve also seen posts where other people have had this problem and it hasn’t been resolved. I only hope it is fixed in a future version of UE

Hey xd009642-

We are still trying to find the reason why certain people are having a problem with creating a new code project. Since you’ve already tired many of the solutions we would suggest (ensuring Windows SDK, checking dependencies and anti-virus) we are looking for other common factors between those with this problem. To help us find what may be the cause can you post the DXDiag for your machine? Additionally if there are any Windows Updates available for your computer I would try running those.

Here is the DXDiag link text, I’m installing some optional updates for windows and then I’ll update to the latest editor release that came out the other day and report back. Hopefully that will work, if not I’ve gone through 4.7.2, 4.8 and the newest version without being able to setup a working code project

Hi xd009642,

Were you able to get this working for you? If not, could you please download this file into an empty folder on your desktop. Remove the .txt extension and run the file. It will create a new Info.txt file containing information about your Visual Studio installation. Please upload that file here so we can take a closer look at it.

Still doesn’t work. And here’s the file: link text

Thanks for providing that. So far everything appears to be ok with both your DXDiag information, as well as the information for your VS installation. You had mentioned previously that you are able to build successfully by manually setting the include location to inherit from defaults, but that adding a new code class removes this setting. Do you see the same result if you manually set the include location and then generate project files for the project?

Hi , I’m not sure what you mean. Do you mean manually set the include location in visual studio or somewhere else?

Also one thing I mentioned previously was it set up the include directories correctly for all the android configurations. Where do I look to see how it’s creating the vs project configurations so I can compare the differences and see if I can get to the bottom of it?

Sorry, I should have been more clear. I was referring to manually setting the include directories in Visual Studio.

The strange thing about this though, is a lot of users with this issue have reported that setting the project’s include directories to inherit from defaults has helped. However, in my own project settings, this has always been blank and I have never experienced this issue.

One bit of positive news is that I was able to reproduce what you described happening when you added a code class to a project for which you had previously set the include directories. The same thing does happen when generating project files, which I was expecting. I have submitted a report of my findings to have this investigated further (UE-18275). Unfortunately this doesn’t solve the root cause of the issue you are experiencing, but it may get us a bit closer.

Hi,

You are correct, inherit from project defaults should not be necessary. However, the overwriting of the include paths during project regeneration is not a supported workflow, so this will not be fixed.

Let’s try and fix your real problem.

Could you answer some of the following, please?

  • Which config are you trying to build?
  • Where is your Visual Studio 2013 install located?
  • Are you using the Express Edition, Professional Edition or Community Edition?
  • What is your InstallationFolder here: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
  • Where is your Visual Studio 2013 install located?
  • If you could find the vcvarsx86_amd64.bat file of your VS2013 installation (e.g. mine is “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat”), could you please run that on a command prompt and then run ‘set > setup.txt’, and then post the setup.txt file here, please.

Steve

  • When I create a code project and it does the initial compile/build that error appears. The only configurations which have the settings filled in are the five android configurations

  • C:\Program Files (x86)\Microsoft Visual Studio 12.0

  • Ultimate edition

  • C:\Program files (x86)\Windows Kits\8.1\

  • setup.txt

Hi,

I just wanted to let you know that Steve is currently out of the office for a few days, and will respond as soon as he gets back.

Hi, sorry for the delay in replying.

The settings in the Android projects should be irrelevant, as the build process does not use the VS solution/projects in any way. Those only exist to aid navigation of your codebase within the IDE.

When I asked which configuration you were building, I meant something like ‘MyGame Debug Editor Win64’.

Also, how are you building? If you are just using VS’s built-in ‘build solution’ command (usually mapped to F7 or Ctrl+Shift+B) then this is not correct as - mentioned above - the UE4 build process does not use the VS project files at all. You should right-click on your game project and select ‘Build’/‘Rebuild’.

Alternatively, you may want to install the UnrealVS extension, which allows you to batch build and also provides a ‘build startup project’ command which you can bind to your preferred keyboard shortcut.

Steve

Hi xd009642,

We have not heard back from you for a few days. Do you still need help with this issue? I will be marking this issue as resolved for internal tracking purposes. If you still need any assistance, please feel free to add a comment to this post which will re-open it.