Failed to produce item - C++ blank code

Hi,
I was trying to do a simple blank code C++ project in unreal but compilation keeps failing, trying to compile in VS 2015 also fails… Here is the output from VS 2015

1>------ Rebuild All started: Project: BuildingEscape, Configuration: Development_Editor x64 ------
1>  Cleaning BuildingEscapeEditor Binaries...
1>  Creating makefile for BuildingEscapeEditor (no existing makefile)
1>  Performing full C++ include scan (no include cache file)
1>  Parsing headers for BuildingEscapeEditor
1>    Running UnrealHeaderTool "D:\UnrealCourse\BuildingEscape\BuildingEscape\BuildingEscape.uproject" "D:\UnrealCourse\BuildingEscape\BuildingEscape\Intermediate\Build\Win64\BuildingEscapeEditor\Development\BuildingEscapeEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
1>  Reflection code generated for BuildingEscapeEditor in 5.3734311 seconds
1>  Performing 7 actions (2 in parallel)
1>  [2/7] Resource PCLaunch.rc
1>  PCH.BuildingEscape.h.cpp
1>  [3/7] Resource ModuleVersionResource.rc.inl
1>  BuildingEscape.cpp
1>  BuildingEscapeGameMode.cpp
1>D:\UnrealCourse\BuildingEscape\BuildingEscape\Source\BuildingEscape\BuildingEscape.cpp : error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header
1>D:\UnrealCourse\BuildingEscape\BuildingEscape\Source\BuildingEscape\BuildingEscapeGameMode.cpp : error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header
1>  BuildingEscape.generated.cpp
1>D:\UnrealCourse\BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Inc\BuildingEscape\BuildingEscape.generated.cpp : error C4599: '/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header
1>ERROR : UBT error : Failed to produce item: D:\UnrealCourse\BuildingEscape\BuildingEscape\Binaries\Win64\UE4Editor-BuildingEscape.dll
1>  Total build time: 95.24 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command ""C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Rebuild.bat" BuildingEscapeEditor Win64 Development "D:\UnrealCourse\BuildingEscape\BuildingEscape\BuildingEscape.uproject" -waitmutex" exited with code -1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Can someone please help?

Ananth

Try closing visual studio, Right clicking you your unreal project file and rebuilding Visual studio project files.

Hi Ananth,

I tried recreating this issue with a new Basic Code project, and the project built fine for me. Is this a brand new project that you are creating, or is it one that you have already been working on for a while? Do you see this same result in different types of projects?

Brand new, I am doing the unreal course on udemy and this was towards that. Could PC specs have anything to do with this - I have a really bad system at work (quadro GPU and AMD processor with 8 GB RAM) - just curious.
I did not try a different project though I did try to compile directly from VS 15 which resulted in the same error.
I will try different project and let you know tomorrow, thanks for the help :slight_smile:

Will try this at work tomorrow - like I said, its a BAD pc!! So I am not sure if that plays any part… thanks for the help :slight_smile:

I tried a blank Blueprint project and that loaded fine. I tried another brand new C++ project and that failed too with the same “Failed to produce item” error… is something missing in my VS 2015 installation? I did a whole round of C++ coding on it just now, so that install is good :frowning:

This did not work. It fails with the same error. :frowning:

I created a brand new C++ blank code project, Unreal failed at its usual place. Then I generated VS project files, opened the sln and did a rebuild and it fails with exactly the same problem… I am thoroughly lost :frowning:

Below are the errors on rebuilding:

Error	C4599	'/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header	MyProject	D:\UnrealCourse\BuildingEscape\MyProject\Source\MyProject\MyProject.cpp	1	

Error	C4599	'/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header	MyProject	D:\UnrealCourse\BuildingEscape\MyProject\Source\MyProject\MyProjectGameMode.cpp	1	

Error	C4599	'/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE': command line argument number 261 does not match precompiled header	MyProject	D:\UnrealCourse\BuildingEscape\MyProject\Intermediate\Build\Win64\UE4Editor\Inc\MyProject\MyProject.generated.cpp	1	

Error		Failed to produce item: D:\UnrealCourse\BuildingEscape\MyProject\Binaries\Win64\UE4Editor-MyProject.dll	MyProject	D:\UnrealCourse\BuildingEscape\MyProject\Intermediate\ProjectFiles\ERROR	1	

Error	MSB3073	The command ""C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Rebuild.bat" MyProjectEditor Win64 Development "D:\UnrealCourse\BuildingEscape\MyProject\MyProject.uproject" -waitmutex" exited with code -1.	MyProject	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets	46

I just wanted to make sure that you are actually using version 4.13.1 of the Engine. The error you are seeing initially appeared in 4.12 when Update 3 for Visual Studio 2015 was released by Microsoft. That was fixed in 4.12.5, so using 4.13.1 with Visual Studio 2015 shouldn’t be giving you this error.

You nailed it sir. I was just going to reply to this whole thread and mark it solved and you beat me to it. I was on 4.12 and after nothing having worked I got 4.13 in and lo behold, all worked well. Picture perfect timing. Thanks a lot for all the help :slight_smile:

Is there some way to mark this question as answered?

Oh crap, that’s true. My version would have misled you, sorry about that…

Glad to know that you were able to get this working. I didn’t recognize the error at first since the post was initially marked as using 4.13. When I looked at it again today I started to think that the error looked familiar, and after a while I remembered where I had seen it before. You should be fine, now.

No worries, it happens. I know this particular issue was a rather significant concern for anyone who updated to Update 3 in Visual Studio 2015, and I should have recognized it and double-checked which version you were using sooner.