Editor fails to compile new C++ project (UE4.10, VS2015)

I was working through the tutorial stuff, and everything was working fine, then I left for a bit, put by computer to sleep, then when I came back and tried to create a new blank C++ project, I got a message saying “The project could not be compiled. Would you like to open it in Visual Studio?” with the following error:

Running C:/Program Files (x86)/Epic Games/4.10/Engine/Binaries/DotNET/UnrealBuildTool.exe HowTo_PlayerCamera Development Win64 -project="C:/Users/Catlin/Documents/Unreal Projects/HowTo_PlayerCamera/HowTo_PlayerCamera.uproject" -rocket -editorrecompile -progress -noubtmakefiles -2015
    @progress push 5%
    Parsing headers for HowTo_PlayerCameraEditor
      Running UnrealHeaderTool "C:/Users/Catlin/Documents/Unreal Projects/HowTo_PlayerCamera/HowTo_PlayerCamera.uproject" "C:\Users\Catlin\Documents\Unreal Projects\HowTo_PlayerCamera\Intermediate\Build\Win64\HowTo_PlayerCameraEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
    Reflection code generated for HowTo_PlayerCameraEditor in 4.2393057 seconds
    @progress pop
    Performing 7 actions (4 in parallel)
    [2/7] Resource PCLaunch.rc
    [3/7] Resource ModuleVersionResource.rc.inl
    PCH.HowTo_PlayerCamera.h.cpp
    C:\Program Files (x86)\Epic Games\4.10\Engine\Source\Runtime\Launch\Resources\Windows\PCLaunch.rc(10) : fatal error RC1015: cannot open include file 'windows.h'.
    C:\Program Files (x86)\Epic Games\4.10\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.10\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(5): fatal error C1083: Cannot open include file: 'new': No such file or directory
    -------- End Detailed Actions Stats -----------------------------------------------------------
    ERROR: UBT ERROR: Failed to produce item: C:\Users\Catlin\Documents\Unreal Projects\HowTo_PlayerCamera\Binaries\Win64\UE4Editor-HowTo_PlayerCamera.dll
    Total build time: 11.79 seconds

And I had done the exact same process to create the other tutorial projects and it all worked fine. If I opened the project manually in VS, I am able to compile it, however, if I add a new Pawn class with the editor, I get the same “Cannot be compiled” error, and even though I can compile it with VS, the asset in the editor doesn’t get updated to reflect the updated source code, event after re-opening the project. (I also tried restarting the computer in case it sleeping screwed up some environment variable or something, but no change).

Just in case it helps, here is basically a play-by-play of exactly what I did:

  1. Was working through tutorial projects, have made it up to the Player Camera one.
  2. Left for a bit, before leaving put computer to sleep (pretty sure had closed Unreal Editor/Launcher and VS before hand)
  3. Came back, woke up computer and started on the Player Camera tutorial.
  4. Created the blank C++ project exactly the same as the previous ones, with name HowTo_PlayerCamera, but upon it trying to compile the code before opening the project in the editor, it gave the message and error.
  5. Finally was able to open project after going into VS and manually building the project (which works).
  6. Tried adding the PawnWithCamera Pawn C++ class through the editor, got message that created the class but couldn’t compile it.
  7. Was able to compile project again in VS, but the Pawn asset would not show up in editor, even after reopening the project. Finally got it to show up after cleaning and building project in VS and reopening the project in the editor.
  8. Filled out all the code for the PawnWithCamera class, but the editor would not see any of the changes (i.e., the components or respond to any of the inputs) event after rebuilding and reopening the project.
  9. Tried restarting computer and verifying UE install, but nothing worked.

Really strange never seen this but it looks like a lot of people have had this issue. I’d recommended going through this link and see what others have tried - it’s all over the place.

Google.