UELinkerFixups.cpp.obj : error LNK2019 linking simple BP uproject with simple c++ class added (only from build UE4.19.1 LocalBuild)

I have a simple default BP Third Person uproject with a simple C++ class added, and no changes to anything in the generated project files.

I use UAT to build from command line from either source-built UE4.19.1 localbuild (in source control) or from installed/retail UE4.19.1. My scripts can switch, as appropriate.

Building with the source-built localbuild results in the following linker error, but building with the installed/retail build does not.

I’m digging, but could use some guidance as to the cause here.

  • thanks

Running: D:\TestRoot\Projects\Tools\UE4\Engine\Binaries\DotNET\UnrealBuildTool.exe TestBuild2 Win64 Development -Project=D:\TestRoot\Projects\Projects\TestBuild2\Game\TestBuild2.uproject D:\TestRoot\Projects\Projects\TestBuild2\Game\TestBuild2.uproject -NoUBTMakefiles -remoteini=“D:\TestRoot\Projects\Projects\TestBuild2\Game” -noxge -NoHotReload -ignorejunk
Performing 2 actions (16 in parallel)
UELinkerFixups.cpp
[2/2] Link TestBuild2.exe
Creating library D:\TestRoot\Projects\Projects\TestBuild2\Game\Binaries\Win64\TestBuild2.lib and object D:\TestRoot\Projects\Projects\TestBuild2\Game\Binaries\Win64\TestBuild2.exp
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodeuicommandinfo(void)” (?EmptyLinkFunctionForGeneratedCodeuicommandinfo@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodedestructibleinterface(void)” (?EmptyLinkFunctionForGeneratedCodedestructibleinterface@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodesoundsourcebus(void)” (?EmptyLinkFunctionForGeneratedCodesoundsourcebus@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodesoundsourcebussend(void)” (?EmptyLinkFunctionForGeneratedCodesoundsourcebussend@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodetimestretchcurve(void)” (?EmptyLinkFunctionForGeneratedCodetimestretchcurve@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodemediablueprintfunctionlibrary(void)” (?EmptyLinkFunctionForGeneratedCodemediablueprintfunctionlibrary@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodemediasoundcomponent(void)” (?EmptyLinkFunctionForGeneratedCodemediasoundcomponent@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodeiosruntimesettings(void)” (?EmptyLinkFunctionForGeneratedCodeiosruntimesettings@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodeiosruntimesettings_init(void)” (?EmptyLinkFunctionForGeneratedCodeiosruntimesettings_init@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinkinterface_init(void)” (?EmptyLinkFunctionForGeneratedCodelivelinkinterface_init@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinkrefskeleton(void)” (?EmptyLinkFunctionForGeneratedCodelivelinkrefskeleton@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinksourcefactory(void)” (?EmptyLinkFunctionForGeneratedCodelivelinksourcefactory@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinktypes(void)” (?EmptyLinkFunctionForGeneratedCodelivelinktypes@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinkmessagebusframework_init(void)” (?EmptyLinkFunctionForGeneratedCodelivelinkmessagebusframework_init@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl EmptyLinkFunctionForGeneratedCodelivelinkmessages(void)” (?EmptyLinkFunctionForGeneratedCodelivelinkmessages@@YAXXZ) referenced in function “void __cdecl UELinkerFixups(void)” (?UELinkerFixups@@YAXXZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol "public: class std::basic_string,class std::allocator > __cdecl AK::WwiseAuthoringAPI::JsonProvider::GetJsonString(void)const " (?GetJsonString@JsonProvider@WwiseAuthoringAPI@AK@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@anonymous_user_e71e0d8a1?$allocator@D@2@@std@@anonymous_user_9674a66c) referenced in function “void __cdecl WampEventCallbacks(unsigned __int64 const &,class AK::WwiseAuthoringAPI::JsonProvider const &)” (?WampEventCallbacks@@YAXAEB_KAEBVJsonProvider@WwiseAuthoringAPI@AK@@@Z)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: __cdecl AK::WwiseAuthoringAPI::Client::Client(void)” (??0Client@WwiseAuthoringAPI@AK@@QEAA@XZ) referenced in function “private: __cdecl FAkWaapiClient::FAkWaapiClient(void)” (??0FAkWaapiClient@@AEAA@XZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: virtual __cdecl AK::WwiseAuthoringAPI::Client::~Client(void)” (??1Client@WwiseAuthoringAPI@AK@@UEAA@XZ) referenced in function “public: virtual __cdecl FAkWaapiClient::~FAkWaapiClient(void)” (??1FAkWaapiClient@@UEAA@XZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: bool __cdecl AK::WwiseAuthoringAPI::Client::Connect(char const *,unsigned int)” (?Connect@Client@WwiseAuthoringAPI@AK@@QEAA_NPEBDI@Z) referenced in function “public: bool __cdecl FAkWaapiClient::AttemptConnection(void)” (?AttemptConnection@FAkWaapiClient@@QEAA_NXZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl AK::WwiseAuthoringAPI::Client::IsConnected(void)const " (?IsConnected@Client@WwiseAuthoringAPI@AK@@QEBA_NXZ) referenced in function “public: bool __cdecl FAkWaapiClient::IsConnected(void)” (?IsConnected@FAkWaapiClient@@QEAA_NXZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: void __cdecl AK::WwiseAuthoringAPI::Client::Disconnect(void)” (?Disconnect@Client@WwiseAuthoringAPI@AK@@QEAAXXZ) referenced in function "public: void __cdecl ::operator()(void)const " (??R@@QEBAXXZ)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: bool __cdecl AK::WwiseAuthoringAPI::Client::Subscribe(char const *,char const *,class std::function,unsigned __int64 &,class std::basic_string,class std::allocator > &,int)” (?Subscribe@Client@WwiseAuthoringAPI@AK@@QEAA_NPEBD0V?$function@$$A6AX_KAEBVJsonProvider@WwiseAuthoringAPI@AK@@@Z@std@@AEA_KAEAV?$basic_string@DU?$char_traits@D@std@@anonymous_user_e71e0d8a1?$allocator@D@2@@anonymous_user_da8fec3a@H@Z) referenced in function “public: bool __cdecl FAkWaapiClient::Subscribe(char const *,class FString const &,class TBaseDelegate >,unsigned __int64 &,class FString &,int)” (?Subscribe@FAkWaapiClient@@QEAA_NPEBDAEBVFString@@anonymous_user_e71e0d8a1?$TBaseDelegate@X_KV?$TSharedPtr@VFJsonObject@@$0A@@@@@AEA_KAEAV2@H@Z)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: bool __cdecl AK::WwiseAuthoringAPI::Client::Unsubscribe(unsigned __int64 const &,class std::basic_string,class std::allocator > &,int)” (?Unsubscribe@Client@WwiseAuthoringAPI@AK@@QEAA_NAEB_KAEAV?$basic_string@DU?$char_traits@D@std@@anonymous_user_e71e0d8a1?$allocator@D@2@@std@@H@Z) referenced in function “public: bool __cdecl FAkWaapiClient::Unsubscribe(unsigned __int64 const &,class FString &,int,bool)” (?Unsubscribe@FAkWaapiClient@@QEAA_NAEB_KAEAVFString@@anonymous_user_e0f39474@Z)
UE4-AkAudio.lib(Module.AkAudio.cpp.obj) : error LNK2019: unresolved external symbol “public: bool __cdecl AK::WwiseAuthoringAPI::Client::Call(char const *,char const *,char const *,class std::basic_string,class std::allocator > &,int)” (?Call@Client@WwiseAuthoringAPI@AK@@QEAA_NPEBD00AEAV?$basic_string@DU?$char_traits@D@std@@anonymous_user_e71e0d8a1?$allocator@D@2@@std@@H@Z) referenced in function “public: bool __cdecl FAkWaapiClient::Call(char const *,class FString const &,class FString const &,class FString &,int,bool)” (?Call@FAkWaapiClient@@QEAA_NPEBDAEBVFString@@1AEAV2@H_N@Z)
D:\TestRoot\Projects\Projects\TestBuild2\Game\Binaries\Win64\TestBuild2.exe : fatal error LNK1120: 24 unresolved externals
ERROR: UBT ERROR: Failed to produce item: D:\TestRoot\Projects\Projects\TestBuild2\Game\Binaries\Win64\TestBuild2.exe
Total build time: 13.04 seconds (Local executor: 0.00 seconds)
Took 13.3473558s to run UnrealBuildTool.exe, ExitCode=5

So, taking the case of a slate export signature, I’ve confirmed that the linker appears to be pulling in the right libs…**

D:\TestRoot\Projects\Tools\UE4\Engine\Binaries\Win64>findstr /ismc:“?EmptyLinkFunctionForGeneratedCodeuicommandinfo@@YAXXZ” *.lib *.dll
UE4-Slate-Win64-Shipping.lib
UE4-Slate.lib

D:\TestRoot\Projects\Tools\UE4\Engine\Binaries\Win64>link /dump /all UE4-Slate-Win64-Shipping.lib | findstr /ic:“EmptyLinkFunctionForGeneratedCodeuicommandinfo”
204162 ?EmptyLinkFunctionForGeneratedCodeUICommandInfo@@YAXXZ
2 ?EmptyLinkFunctionForGeneratedCodeUICommandInfo@@YAXXZ
COMDAT; sym= “void __cdecl EmptyLinkFunctionForGeneratedCodeUICommandInfo(void)” (?EmptyLinkFunctionForGeneratedCodeUICommandInfo@@YAXXZ)
72F 00000000 SECT119 notype () External | ?EmptyLinkFunctionForGeneratedCodeUICommandInfo@@YAXXZ (void __cdecl EmptyLinkFunctionForGeneratedCodeUICommandInfo(void))

???

I’ve confirmed that link.exe is getting the same params in our Projects\TestBuild2\Game\Intermediate\Build\Win64\TestBuild2\Development\TestBuild2.exe.response

The problem has to be either in the generated project .obj’s or in the ue4 .libs built from source.

???

I discovered a casing problem in the generated uelinkerfixups.cpp in the failing build. Snippet of windiff output (failing build lines are every second line)…

extern void EmptyLinkFunctionForGeneratedCodeLiveLinkInterface_init();
extern void EmptyLinkFunctionForGeneratedCodelivelinkinterface_init();

EmptyLinkFunctionForGeneratedCodeLiveLinkInterface_init();
EmptyLinkFunctionForGeneratedCodelivelinkinterface_init();

extern void EmptyLinkFunctionForGeneratedCodeLiveLinkRefSkeleton();
extern void EmptyLinkFunctionForGeneratedCodelivelinkrefskeleton();

EmptyLinkFunctionForGeneratedCodeLiveLinkRefSkeleton();
EmptyLinkFunctionForGeneratedCodelivelinkrefskeleton();

extern void EmptyLinkFunctionForGeneratedCodeLiveLinkSourceFactory();
extern void EmptyLinkFunctionForGeneratedCodelivelinksourcefactory();

EmptyLinkFunctionForGeneratedCodeLiveLinkSourceFactory();
EmptyLinkFunctionForGeneratedCodelivelinksourcefactory();


extern void EmptyLinkFunctionForGeneratedCodeLiveLinkTypes();
extern void EmptyLinkFunctionForGeneratedCodelivelinktypes();

EmptyLinkFunctionForGeneratedCodeLiveLinkTypes();
EmptyLinkFunctionForGeneratedCodelivelinktypes();

extern void EmptyLinkFunctionForGeneratedCodeLiveLinkMessageBusFramework_init();
extern void EmptyLinkFunctionForGeneratedCodelivelinkmessagebusframework_init();

EmptyLinkFunctionForGeneratedCodeLiveLinkMessageBusFramework_init();
EmptyLinkFunctionForGeneratedCodelivelinkmessagebusframework_init();

extern void EmptyLinkFunctionForGeneratedCodeLiveLinkMessages();
extern void EmptyLinkFunctionForGeneratedCodelivelinkmessages();

EmptyLinkFunctionForGeneratedCodeLiveLinkMessages();
EmptyLinkFunctionForGeneratedCodelivelinkmessages();

This feels like a bug.

Here’s the code that builds the linker response file…

Tools\UE4\Engine\Source>findstr /s EmptyLinkFunctionForGeneratedCode *.cs *.c *.cpp *.h
Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs: string FunctionName = “EmptyLinkFunctionForGeneratedCode” + Path.GetFileName(CppFile).Replace(“.gen.cpp”, “”).Replace(“.”, “_”);
Programs\UnrealBuildTool\Platform\Android\AndroidToolChain.cs: Result.Add(" void EmptyLinkFunctionForGeneratedCode" + ModName + “(){}”);
Programs\UnrealHeaderTool\Private\CodeGenerator.cpp: Out.Logf(TEXT(“void EmptyLinkFunctionForGeneratedCode%s() {}”) LINE_TERMINATOR, EmptyLinkFunctionPostfix);

Sure enough, we have a lower-cased files in source control…

Tools\UE4\Engine\Intermediate\Build\Win64\UE4\Inc\LiveLinkInterface\livelinkinterface.init.gen.cpp
Tools\UE4\Engine\Intermediate\Build\Win64\UE4\Inc\LiveLinkInterface\livelinkinterfaceclasses.h

Trying to track down if the UE4 source build did that or P4.

Looks like it was Perforce that probably caused the case problem as several subtrees were entirely lowercased in one copy of UE4 LocalBuild in source control, but not another. Both were populated with robocopy /MIR. Very odd. One possible factor is that our Helix server/clients is/are configured with the default, case-insensitive, setting (which we’ll flip)…

Server case handling: insensitive
clientCase: insensitive

So, there’s still some fragility here in the UE4 build system that’s worth noting: If you see linker errors related to UELinkerFixups.cpp.obj, consider this filename case problem and look at re-generating your UE4 Engine intermediates or project intermediates as a possible remedy.

  • thanks