Unresolved external symbol inheriting from APaperSpriteActor in 4.5 binary release

I added a new SpriteActor to a Paper2D template project via the 4.5 editor.

The project was created in 4.4 and update to use 4.5 binaries without issue.

Linking failed due to an unresolved symbol. I made no modification to the new sprite actor before attempting to compile


The error,

error LNK2001: unresolved external symbol "public: virtual bool __cdecl APaperSpriteActor::GetReferencedContentObjects(class TArray &)const " (?GetReferencedContentObjects@APaperSpriteActor@@UEBA_NAEAV?$TArray@PEAVUObject@@VFDefaultAllocator@@@@@Z)


My build.cs,

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine",
 "InputCore", "GameplayAbilities", "GameplayTags", "Paper2D" });

I found a workaround posted on the forums that will work for the time being,

#if WITH_EDITOR
bool APaperSpriteActor::GetReferencedContentObjects(TArray<UObject*>& Objects) const
{
	if (UPaperSprite* SourceSprite = RenderComponent->GetSprite())
	{
		Objects.Add(SourceSprite);
	}
	return true;
}
#endif

This is kind of a weird one, because I do see that GetReferencedContentObjects exists in APaperSpriteActor…

Edit1: Tested in 4.4.3 with a fresh template project and getting the same error. Unresolved external symbol GetReferencedContentObjects…

Edit2: Tried to inherit from AAmbientSound and linking failed with same error. Seems like it’s been excluded from the binary release by the #if WITH_EDITOR check??

Hi ,

Thank you for pointing this out. I have submitted a report to have this issue investigated further (TTP 349843). I also did some experimenting to try to find a workaround, but was not able to do so.

Hey , the workaround is to copy and paste the missing implementations into your own project. It’s a bit of a hassle but it gets things going.

I’ve added full DLL export to the other classes in this commit: https://github.com/EpicGames/UnrealEngine/commit/376ad40ff8cfa2894c7201507301ca32917f5c55, which should fix the issues you were seeing.

You ought to be able to work around it by just creating a sprite component in your own actor class derived from AActor. There isn’t any real code in APaperSpriteActor, it’s just a wrapper around the component.

Cheers,
Michael Noland