I got the below linker error after upgrading UE 5.0.3 to UE 5.1.1
[28/29] Link UnrealEditor-MyProj.dylib
Undefined symbols for architecture x86_64:
“UTextureRenderTarget2D::CalcTextureMemorySizeEnum(ETextureMipCount) const”, referenced from:
vtable for UMyProjCanvasRenderTarget in MyProjCanvasRenderTarget.gen.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[29/29] WriteMetadata MyProjEditor.target cancelled
My platform is Intel Mac. I’m using Xcode 14.2 on macOS Ventura 13.2.1
And my project code could be compiled with UE 5.0.3
The code related to this issue is about a class derived from UCanvasRenderTarget2D. Both UTextureRenderTarget2D and UCanvasRenderTarget2D are within ENGINE module according to the UE5.1 documentation.
Here’re the lines about module dependency on my bulld.cs:
PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “UMG”, “Paper2D”, “AIModule” });
PrivateDependencyModuleNames.AddRange(new string[] { “Slate”, “SlateCore”, “RenderCore” });
I couldn’t figure out how to solve this issue. Is it a bug of UE 5.1.1?