When I forward declare my “APlayerCharacter” class in .h files and include it in .cpp this error shows up:
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\Templates/SubclassOf.h(64): Error C2027 : use of undefined type 'APlayerCharacterBase'
0>{ProjectDir}/Player/Others/DataAssets/DataAsset_Player.h(10): Reference C2027 : see declaration of 'APlayerCharacterBase'
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\Templates/SubclassOf.h(63): Reference C2027 : while compiling class template member function 'UClass *TSubclassOf<APlayerCharacterBase>::operator *(void) const'
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\Templates/SubclassOf.h(86): Reference C2027 : see reference to function template instantiation 'UClass *TSubclassOf<APlayerCharacterBase>::operator *(void) const' being compiled
0>{ProjectDir}/Player/Others/DataAssets/DataAsset_Characters.h(20): Reference C2027 : see reference to class template instantiation 'TSubclassOf<APlayerCharacterBase>' being compiled
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\Templates/SubclassOf.h(64): Error C2672 : 'StaticClass': no matching overloaded function found
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\Templates/SubclassOf.h(64): Error C2783 : 'UClass *StaticClass(void)': could not deduce template argument for 'ClassType'
0>UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/ReflectedTypeAccessors.h(13): Reference C2783 : see declaration of 'StaticClass'
It was all working fine a few compiles earlier.
Its solved by removing the forward declare and including the header directly.
But I was wondering why is this happening?