I get a LNK error when I add the UPROPERTY TSubclassOf

When i compile my code at this stage i get this error ShooterPlayerController.gen.cpp.obj : error LNK2019: unresolved external symbol

This only happens when i add this section of code wverything works up untill this point.
Ive tried googling my issue but cant seem to find anything

Am i missing something simple

Any help is appreciated

Could you share the full error? What code were you adding at the time?

I was adding
UPROPERTY(EditAnywhere)
TSubclassOf LoseScreenClass;

And the full error is:
ShooterPlayerController.gen.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) class UClass * __cdecl Z_Construct_UClass_UUserWidget_NoRegister(void)” (_imp?Z_Construct_UClass_UUserWidget_NoRegister@@YAPEAVUClass@@XZ) referenced in function “void __cdecl `dynamic initializer for ‘public: static struct UE4CodeGen_Private::FClassPropertyParams const Z_Construct_UClass_AShooterPlayerController_Statics::NewProp_LoseScreenClass’’(void)” (??__E?NewProp_LoseScreenClass@Z_Construct_UClass_AShooterPlayerController_Statics@@2UFClassPropertyParams@UE4CodeGen_Private@@B@@YAXXZ)

Most likely didn’t add “UMG” to your Build.cs

5 Likes

That fixed it thanks

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms