Basic C++ template does not compile

Hello there.
I’m trying to setup VS2013 and UE4 to start developing using a basic C++ template but I can’t get it running properly…

I can create a new project from Blueprints and it runs, so it should not be a problem of UE installation.
But when I try to create a new project from C++ template, UE4 says there was an error while compiling and lets me open it with VS. When I try to build it from VS it throws me that error:

1>------ Build started: Project: MyProject, Configuration: DebugGame_Editor x64 ------
1>  Performing 7 actions (4 in parallel)
1>  [3/7] Resource MyProject.rc
1>  [2/7] Resource ModuleVersionResource.rc.inl
1>C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Core\Resources\Windows\ModuleVersionResource.rc.inl(3): fatal error RC1015: cannot open include file 'windows.h'.
1>  
1>K:\PROYECTOS\Juegos\UE4\MyProject\Source\MyProject\Resources\Windows\MyProject.rc(8): fatal error RC1015: cannot open include file 'windows.h'.
1>  
1>  PCH.MyProject.MyProject.h.cpp
1>C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(5): fatal error C1083: Cannot open include file: 'new': No such file or directory
1>  -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: K:\PROYECTOS\Juegos\UE4\MyProject\Binaries\Win64\UE4Editor-MyProject-Win64-DebugGame.dll
1>  Cumulative action seconds (4 processors): 0,00 building projects, 0,75 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
1>  UBT execution time: 4,67 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""C:\Program Files\Epic Games\4.7\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 DebugGame "K:\PROYECTOS\Juegos\UE4\MyProject\MyProject.uproject" -rocket" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I’ve removed every Visual Studio program and folder (from /Program Files and /Program Files(x86)), excepting VS2010 for Office.

I reinstalled VS2013 Community directly from Microsoft’s webpage, and also did it from UE4 launcher (when you try to create a new project from C++ templates it checks if you have VS and, if not, tells you to install it).
When I installed VS I did not choose to install Windows Phone SDK, SQL for Visual Studio, Microsoft App helper and other optional stuff it lets you install.

EDIT: I reinstalled Epic Games Launcher (and, of course, UE4) cleaning the registry and deleting all folders related under Program Files. Still doesn’t work.

I don’t know why it can’t find ‘windows.h’ and haven’t found any effective solution anywhere.
Thanks in advance to anyone who can help me.

did you install VS before of after you installed UE4 ?

I uninstalled both. Installed VS and then UE4.

Then I uninstalled VS and installed it again without re-installing UE4.

If there is a way I can clearly re-install both making sure it will work, would appreciate if you tell me how.
Thanks

Have you installed Windows 8.1 SDK?

  1. Install DirectX runtime
  2. Install Windows 8.1 SDK
  3. Install Visual studio 2013 (pro or community)
  4. Try compiling now.

If this still does not work, try re-installing UE4 - Sometimes UE4 fails to detect 8.1 SDK if it was installed later.

Yes, I have installed Windows SDK for Windows 8.1.

Currently uninstalling UE4, I’ll do it using Advanced uninstaller PRO to check anything is left in the registry or wherever else.

Will update answer after trying. Thanks

EDIT: Updated question, it didn’t work…

Ok, so after some hours of googling and tons of lines read later, I got the solution. I haven’t been able to check if the editor works well, but at least now it compiles from VS and runs UE Editor.

The solution is this:

  1. Create the project from template, if UE tells you it failed to compile, open the project with VS.
  2. Wait until VS finishes trying to build it if this is the case.
  3. Right-click on the project (inside solution explorer) > Properties.
  4. Click on Include Directories and, in the dropdown choose ``, check it adds something like $(VC_IncludePath);$(WindowsSDK_IncludePath);.
  5. Do the same for Library Directories. It should be something like $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);.

For both Include Directories and Library Directories, if you click on * instead of *, you should see at the bot side those inherited path roots.

Hope this helps someone.

Best Regards

thank you, this has actually solved the issue from 4.11 in 4.13.

  1. At your suggested step 1, when I press open in Visual Studio button it does nothing.
  2. When I open the folder project in VS 2017 from explorer, r-clicking on the root folder in solution explorer, yields no properties. Same about the .uproject.

this happened to me, because i installed msvs AFTER making a BP project. after making a source file C++ class inside my bp project, i deleted saved and intermediates from the bp project. after deleting data and cooked info it worked for me. 4.8.13 here 3/22/2018. 5 am

I don’t see “Include directories” from the properties window.

I did not have dropdown menu so i copy pasted the suff you wrote but it still doenst work. Any other ideas?