Error "Assertion failed: FoundClass [File:...\Private\HeaderParser.cpp]"

Upon compiling a C++ project, I got the following error :

2>    Running UnrealHeaderTool "C:\Projects\MyGame\MyGame.uproject" "C:\Projects\MyGame\Intermediate\Build\Win64\MyGameEditor\Development\MyGameEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors
2>  C:/Projects/MyGame/Source/MyGame/Public/MyHeader.h(120) : LogWindows:Error: === Critical error: ===
2>  Assertion failed: FoundClass [File:C:\Projects\UnrealEngine4.12\Engine\Source\Programs\UnrealHeaderTool\Private\HeaderParser.cpp] [Line: 4764]
2>Error : Failed to generate code for MyGameEditor - error code: CrashOrAssert (3)
2 Likes

For your information, I found the cause, which may hard to find as no line in the file is given.
This comes from using the following syntax :

/*

/** A doxygen like comment (etc) */

This should be because there’s an opening c++ comment (/) followed by a doxygen like comment (/**) and one closing c++/doygen comment (/). This makes the UnrealHeaderTool crash.

Hope this helps anyone getting the same error, as I did not find any post for this issue.

Thanks for reporting this, I’ll file a ticket to get the crash fixed.

Steve

I know this is an old post, but this still happens today (August 2020). It was hard to find where the error was but I found I could right click on the following line in Visual Studio’s Output window and click “GoToLocation”, and even though it didn’t take me exactly to the error spot, it opened the correct header document that had the error in it:

![2>D:/ : LogWindows: Error: Assertion failed: FoundClass [File:D:/Build/++UE4+Licensee/Sync/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp] [Line: 6094]

]1

My issue was that I had a URL in a comment and the ‘//’ part must have been confusing the Unreal Header Tool because it’s between the /* */. As soon as I deleted one of the /, it compiled no problem:

Does not compile:

/*Blend Depth to continue the blend to
Note: See https://www.youtube.com/watch?v=ffuq5k-j0AY&feature=youtu.be&t=3627 for explanation of Blend Depth*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Blend, meta = (PinShownByDefault, DisplayName = "In Blend Depth"))
	int32 BlendDepth = 1;

Does compile:

/*Blend Depth to continue the blend to
Note: See https:/www.youtube.com/watch?v=ffuq5k-j0AY&feature=youtu.be&t=3627 for explanation of Blend Depth*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Blend, meta = (PinShownByDefault, DisplayName = "In Blend Depth"))
	int32 BlendDepth = 1;