Why am I seeing an error message stating that GetMetaData is not a member of UClass?

D:\Users\Unreal
Projects\MyProject\Source\MyProject\MyHUD.cpp(18):
error C2039: ‘GetMetaData’ : is not a
member of ‘UClass’ 2>
D:\Users\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(1576)
: see declaration of ‘UClass’

This is beyond frustrating. Everything was working fine, I didn’t even change the file. All I did was close the editor and try to rebuild as a Development-Editor project instead of Deubg-Editor, because of another UE4 bug. Here is the definition of MyHUD.h .

////////////////////////////////////////////////////////////////////////////////////////////////////
///// MyHUD.h
///// User created HUD class
///// 5/28/2014

#pragma once

#include "GameFramework/HUD.h"
#include "MyHUD.generated.h"
 
/**  *   */ UCLASS(config=Game,
hidecategories=(Rendering,Actor,Input,Replication),
notplaceable, transient,
dependson=UCanvas, BlueprintType,
Blueprintable) class AMyHUD : public
AHUD { 	GENERATED_UCLASS_BODY()

	void DrawHUD(); 	 
};

Any idea why things would work fine for one build and not work the next? Also, I’m staring right at GetMetaData in the UClass definition. Why it’s said to not be a member of UClass Is beyond me, I’m staring right at it.

I got a tip in IRC.

quite a lot of editor side code has
preprocessor stuff to include /
exclude it from certain build configs

GetMetaData must be included or excluded from certian build targets.

Hi Bleakwise,

I set up a class derived from HUD based on the .h you provided, but I was not able to see the error message you mentioned when changing between Debug Editor and Development Editor configurations. Would you be able to provide the code in your .cpp for the class?

Hi Bleakwise,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

I also have this problem,