Download

Pure virtual functions compile error

This compile error randomly started happening, and I’m not sure what I had done to cause it. How would I go about pinpointing this issue?


2>    Running UnrealHeaderTool "C:\Users\Rael\Documents\Unreal Projects\Swatter\Swatter.uproject" "C:\Users\Rael\Documents\Unreal Projects\Swatter\Intermediate\Build\Win64\SwatterEditor\DebugGame\SwatterEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
2>LogWindows : error : === Critical error: ===
2>  LowLevelFatalError [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\UnrealType.h] [Line: 129]
2>  Pure virtual not implemented (UProperty::GetCPPTypeForwardDeclaration)
2>Error : Failed to generate code for SwatterEditor - error code: CrashOrAssert (3)
2>  UnrealHeaderTool failed for target 'SwatterEditor' (platform: Win64, module info: C:\Users\Rael\Documents\Unreal Projects\Swatter\Intermediate\Build\Win64\SwatterEditor\DebugGame\SwatterEditor.uhtmanifest).
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""G:\Program Files\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" SwatterEditor Win64 DebugGame "C:\Users\Rael\Documents\Unreal Projects\Swatter\Swatter.uproject" -waitmutex" exited with code 3.

Unfortunately, if the compiler does not point to a specific line where the error occured, the only way to find the error, is to carefully read through the code. A good practice to prevent critical errors from happening, is to always backup your source files, and even to keep all your old backups. This way it will always be possible to isolate the problem with a working build and adding each change you did one at a time until the error occurs. This can be the difference between weeks to months of down time finding an elusive bug, compared to reverting back and simply rewriting the buggy part.

It does not seem to be a compile error related to the code in your project (at least not directly). But it seems that during the build process when UnrealHeaderTool runs with the commandline arguments “C:\Users\Rael\Documents\Unreal Projects\Swatter\Swatter.uproject” “C:\Users\Rael\Documents\Unreal Projects\Swatter\Intermediate\Build\Win64\SwatterEditor\DebugGame\SwatterEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed". It crashes because UProperty::GetCPPTypeForwardDeclaration is not implemented by some subclass.
You can try to debug UnrealHeaderTool to see where it’s going wrong. If you’re using a custom build from engine source you can even make the necessary changes yourself and have the entire Unreal Engine community profit from it by creating a pull request for Epic to consider your changes.

@UnrealEverything You’re my hero. I would never consider changing the engine to make a custom build, that’s way to complicated. Nice youtube channel:D

How would I debug UHT if not from source? I can’t find a target for it.

Ended up fixing it anyway, didn’t realize that TMaps can’t be used as parameters or return values. Would be nice to have a more obvious error message for it.