So I’ve struggled over this one before and my easiest fix was just to check out a new copy of the engine and start over. Can’t do that this time though.
So by default the engine wants to build as Win32, which obviously doesn’t work. So I made a new active solution called Win64 a per some tutorials and end up with this:
Is that what that should look like? When I try to build it I get:
27>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Client Win64 Development" exited with code -1.
I just realised that I’ve missed the actual error code:
26>Error : Failed to generate code for UE4Editor - error code: OtherCompilationError (5)
No amount of googling is helping me solve this - is there a list of OtherCompilationError codes anywhere?
I’ve also tried deleting the binaries and .pdb files and rebuilding - no difference.
Okay! I’ve figured out how to get WAY more information.
Open a command prompt and navigate to: **Engine/Binaries/DotNet/
**
Then run UnrealBuildTool.exe UE4Editor Win64 Development -DEPLOY
This is what I get back for example, which includes some things I’ve modified:
Detected mismatched version in UHT binary UnrealHeaderTool-ScriptGeneratorPlugin.dll (API Version 2579680, expected: 0)
Building UnrealHeaderTool...
Performing 1 actions (4 in parallel)
[1/1] Link UnrealHeaderTool-ScriptGeneratorPlugin.dll
Creating library c:\UnrealEngine\MyCustomEngine\Engine\Plugins\ScriptGeneratorPlugin\Intermediate/Build/Win64\UnrealHeaderTool\Development\UnrealHeaderTool-ScriptGeneratorPlugin.lib and object c:\UnrealEngine\MyCustomEngine\Engine\Plugins\ScriptGeneratorPlugin\Intermediate/Build/Win64\UnrealHeaderTool\Development\UnrealHeaderTool-ScriptGeneratorPlugin.exp
-------- End Detailed Actions Stats -----------------------------------------------------------
Total build time: 14.52 seconds
Parsing headers for UE4Editor
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/Engine/EngineTypes.h(239) : Illegal enumeration tag specified. Conflicts with auto-generated tag 'Quality_MAX'
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/Components/ActorComponent.h(375) : Unrecognized type 'EEndPlayReason'
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/Components/SceneComponent.h(195) : Expected the name of a previously defined enum
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h(27) : Unrecognized type 'FHitResult'
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/AI/Navigation/NavLinkCustomComponent.h(191) : Expected the name of a previously defined enum
Error: Failed to generate code for UE4Editor - error code: OtherCompilationError (5)
UnrealHeaderTool failed for target 'UE4Editor' (platform: Win64, module info: c:\UnrealEngine\MyCustomEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealHeaderTool.manifest).
So if you’re stuck with single-line errors not telling you much at all, try building it using the UBT directly!
So I’ve narrowed my problem down to this:
c:/UnrealEngine/MyCustomEngine/Engine/Source/Runtime/Engine/Classes/Engine/EngineTypes.h(239) : Illegal enumeration tag specified. Conflicts with auto-generated tag 'Quality_MAX'
/** Lighting build quality enumeration */
UENUM()
enum ELightingBuildQuality
{
Quality_Preview,
Quality_Medium,
Quality_High,
Quality_Production,
Quality_MAX,
Quality_Custom
};
Does anyone know what this means? I’m basically adding a member to the ELightingBuildQuality enumerator. I don’t know what it means by “conflicts with auto-generated tag”.
If I take out Quality_MAX it gets past this point, but other things miss Quality_MAX after that. Not sure what to do here.
So I’ve figured THAT out too. In retrospect the answer was above, below and in the docs I read, but I didn’t click.
Quality_MAX isn’t maximum quality. It’s the end of the enumerator, which exists because C++ likes to do funny things with shared namespaces. I hadn’t previously wanted to overwrite its position because if it was a quality level, I could see some quality levels being assigned by index rather than by name. So adding _custom in the middle would be unsafe.
I moved my custom quality level above the _MAX index and it just worked.