Error Compiling Clean Code - Failed to produce item UnrealHeaderTool-Core.dll

I am following the “Downloading and Building UE4 Source” video and am attempting to compile the engine. I get the following error:

Failed to produce item: ...\UnrealHeaderTool-Core.dll

I have made no changes to the code. My googling has returned various solutions, none of which have been the problem so I am guessing this is some kind of general error… I am running Visual Studio 2013 Professional. I have Visual Assist. I have Incredibuild installed in a different version of VS, but it doesn’t seem to be enabled in 2013. I have multiple versions of Visual Studio (2008, 2010, 2012) all pro.

I have downloaded both required zip files. I have installed the DX2010 run time (from here)

Full output:

23>  Building UnrealHeaderTool...
23>ERROR : UBT error : Failed to produce item: C:\dev\UnrealEngine\Engine\Binaries\Win64\UnrealHeaderTool-Core.dll
23>  XGE execution time: 1.90 seconds
23>  UnrealHeaderTool failed for target 'UE4Editor' (platform: Win64, module info: C:\dev\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\DebugGame\UnrealHeaderTool.manifest).
23>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Win64 DebugGame" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 29 skipped ==========

Thank you

Incredibuild was the issue. The problem is Unreal uses a tool called xgConsole. Incredibuild also has a command line tool called xgConsole so it calls the wrong one.

To fix this, removing the Incredibuild path from your environments PATH variable will stop the UBT (Unreal Build Tool) using the wrong program.

All I can say is, thank goodness you can step through the build tool code… would never have found that from the error message!

Some additional information for people getting the above error message but don’t have incredibuild:

  • The error is from the link task from running the UBT trying to build the header tool
  • Isn’t related to this file, for me it was the first compilation task that failed (since couldn’t launch the xgConsole tool).

To debug from the source code, you need to run the UnrealBuildTool project with the following settings:

First:

 UE4Editor Win64 Debug 

This will run the tool as it would normally. This launches itself (which is where the problem was for me). This sub instance can be launched to debug using the same project but with the following command line arguments:

UnrealHeaderTool Win64 Debug -NoMutex

Hopefully this will be useful to someone :slight_smile:

Yes, it solves my problem, but it looks very perverted