FObjectFinder fails only in packaged game

Dan Hertzka
Sat, 19 Apr 2014 01:55:08 +0000
Platform & Builds

We’re able to successfully package our game for Windows with no errors, but the actual executable throws a null reference exception when loading the game mode’s DefaultPlayerPawn via FObjectFinder:

static ConstructorHelpers::FObjectFinder<UClass> PlayerPawnBPClass(TEXT("Class'/Game/Blueprints/NNRCharacterBP.NNRCharacterBP_C'"));
	if (PlayerPawnBPClass.Object != NULL)
	{
		DefaultPawnClass = PlayerPawnBPClass.Object;
	}

This works just fine when launching from the editor.

Here’s the relevant portion of the call stack.

 NNR-Win64-DebugGame.exe!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 822	C++
 NNR-Win64-DebugGame.exe!StaticLoadObject(UClass * ObjectClass, UObject * InOuter, const wchar_t * InName, const wchar_t * Filename, unsigned int LoadFlags, UPackageMap * Sandbox, bool bAllowObjectReconciliation) Line 671	C++
>NNR-Win64-DebugGame.exe!ConstructorHelpersInternal::FindOrLoadObject<UClass>(FString & PathName) Line 31	C++

Unfortunately this is not a full-source project, but a separate C++ game module created via the editor New Project Wizard (is “content-only project” the proper designation for that?). This won’t allow me to see StaticLoadObject() or LoadPackage(), so I’m not able to follow what exactly is failing. Line 822 in UObjectGlobals.cpp corresponds to:

Linker->LinkerRoot->ThisRequiresLocalizationGather(Linker->RequiresLocalizationGather());

So something in there is null. “Linker” is checked for null prior to this line and the stack doesn’t show either function is entered, so I assume “LinkerRoot” is the culprit, but I’m not sure what to make of that.

I’m hoping I’ve just missed something simple and said enough to ring a bell for someone. Been at this for a while and would really appreciate any help. If you’d like more info please ask. Thanks everyone!

-Dan

Edit: Here’s the log

2 posts - 1 participant