Compile Failed when creating Cpp project

I recently updated Visual Studio to include all the Android SDK’s as I was having problems getting a VR project to work on my Nexus 6. This solved that particular problem in a blueprints project, but when creating a Cpp project I get an error and the project doesn’t even open! Below is the message that is returned:


The project could not be compiled. Would you like to open it in Visual Studio?

Running F:/Programs/GameDevTools/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject Development Win64 -project=“E:/Programs/Game Creation Tools/Epic Games/UE4/Projects/VR_Cpp_Temp3/MyProject/MyProject.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE

@progress push 5%

Parsing headers for MyProjectEditor

Running UnrealHeaderTool “E:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\MyProject.uproject” “E:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 3.8302828 seconds

@progress pop

Performing 7 actions (9 in parallel)

[2/7] Resource PCLaunch.rc

[3/7] Resource ModuleVersionResource.rc.inl

PCH.MyProject.h.cpp

MyProjectGameMode.cpp

MyProject.cpp

MyProject.generated.cpp

E:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\Intermediate\Build\Win64\UE4Editor\Inc\MyProject\MyProject.generated.cpp: error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 261 does not match precompiled headerE:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\Source\MyProject\MyProjectGameMode.cpp: error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 261 does not match precompiled headerE:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\Source\MyProject\MyProject.cpp: error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 261 does not match precompiled header

ERROR: UBT ERROR: Failed to produce item: E:\Programs\Game Creation Tools\Epic Games\UE4\Projects\VR_Cpp_Temp3\MyProject\Binaries\Win64\UE4Editor-MyProject.dll

Total build time: 43.48 seconds


After opening it in Visual Studio and waiting for the build to finish, I find that I need to go to the .uproject file in Windows Explorer and double-click it to open the engine. I am greeted with this message:

96859-vr_temp_3.png

After clicking ‘Yes’, I am greeted with this message:

96860-vr_temp_3_2.png

So I go back into Visual Studio, right-click on the project and select Build, after which I am confronted with the following errors:

At this point I am unsure how to proceed. Please Help!

Are you using Visual Studio 2015, Update 3?

That version added a new warning, and we’re accidentally treating it as an error. It has been fixed for the next version of 4.12, but until then you’ll either need to use Update 2, or use GitHub build.

https://github.com/EpicGames/UnrealEngine/commit/f011bacaaf292ebdc8f33fdeb78bb14d30eaa6bc

I’m not sure actually. I know the installer will only let you install the latest update version, however you might be able to remove Update 3 via Windows Update if this is to be believed (it’s for an older version of VS).

I believe I am using Update 3. To revert back to Update 2, will I need to run the Visual Studio executable again and uncheck the appropriate boxes? Or is there a way of doing it by opening Visual Studio?

Thanks Jamie. I think it might be easier just waiting for the next version of 4.12 than messing around with things too much. I’m only just starting out experimenting using VR and a blueprints project works fine, so I think I’ll just do that for now.

I found another question about this same error, and the comments there do list a way to only install Update 2.

The easiest way to revert to Update 2 is to uninstall Visual Studio, download one of the Update 2 ISOs for example from here: https://gist.github.com/CHEF-KOCH/8078b39e1aad71ef6c317a3c0edb6ec9 and disable Internet connection before and during installation process. Note that this way you won’t be able to install some of the additional components.