ConstructorHelpers::FObjectFinder unresolved external symbol

Ah that’s it. I am using an editor plugin and attempting to spawn a blue print in the level.

I have a line in my code:

ConstructorHelpers::FObjectFinder<UBlueprint> MyBlueprint(TEXT("/UnityBP/Gen_Apple_A"));

To try and find a blue print in my content browser. When I try to build the game though I get:

1>HamadsPlugin.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class UObject * __cdecl StaticLoadObject(class UClass *,class UObject *,wchar_t const *,wchar_t const *,unsigned int,class UPackageMap *,bool)" (__imp_?StaticLoadObject@@YAPEAVUObject@@PEAVUClass@@PEAV1@PEB_W2IPEAVUPackageMap@@_N@Z) referenced in function "class UBlueprint * __cdecl ConstructorHelpersInternal::FindOrLoadObject<class UBlueprint>(class FString &)" (??$FindOrLoadObject@VUBlueprint@@@ConstructorHelpersInternal@@YAPEAVUBlueprint@@AEAVFString@@@Z)
1>HamadsPlugin.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class UObject * __cdecl UClass::GetDefaultObject(bool)" (__imp_?GetDefaultObject@UClass@@QEAAPEAVUObject@@_N@Z) referenced in function "class UBlueprint * __cdecl ConstructorHelpersInternal::FindOrLoadObject<class UBlueprint>(class FString &)" (??$FindOrLoadObject@VUBlueprint@@@ConstructorHelpersInternal@@YAPEAVUBlueprint@@AEAVFString@@@Z)
1>HamadsPlugin.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl ConstructorHelpers::StripObjectClass(class FString &,bool)" (__imp_?StripObjectClass@ConstructorHelpers@@SAXAEAVFString@@_N@Z) referenced in function "public: __cdecl ConstructorHelpers::FObjectFinder<class UBlueprint>::FObjectFinder<class UBlueprint>(wchar_t const *)" (??0?$FObjectFinder@VUBlueprint@@@ConstructorHelpers@@QEAA@PEB_W@Z)
1>HamadsPlugin.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl ConstructorHelpers::ValidateObject(class UObject *,class FString const &,wchar_t const *)" (__imp_?ValidateObject@ConstructorHelpers@@CAXPEAVUObject@@AEBVFString@@PEB_W@Z) referenced in function "public: __cdecl ConstructorHelpers::FObjectFinder<class UBlueprint>::FObjectFinder<class UBlueprint>(wchar_t const *)" (??0?$FObjectFinder@VUBlueprint@@@ConstructorHelpers@@QEAA@PEB_W@Z)
1>HamadsPlugin.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl ConstructorHelpers::CheckIfIsInConstructor(wchar_t const *)" (__imp_?CheckIfIsInConstructor@ConstructorHelpers@@CAXPEB_W@Z) referenced in function "public: __cdecl ConstructorHelpers::FObjectFinder<class UBlueprint>::FObjectFinder<class UBlueprint>(wchar_t const *)" (??0?$FObjectFinder@VUBlueprint@@@ConstructorHelpers@@QEAA@PEB_W@Z)
1>C:\UDK\TMP\MAIN\Plugins\HamadsPlugin\Binaries\Win64\UE4Editor-HamadsPlugin.dll : fatal error LNK1120: 5 unresolved externals

What do I need to do to get this API call to work?

Thanks

Did you mean to use FObjectFinder<AActor> instead of FObjectFinder<UBlueprint> ?

Edit: Also, you can only use that function inside of an object initializer (I’m not sure if you are or not) and sometimes it might not produce a useful error message and instead fail at link time.