C++ - Error Linking ShooterGame Sample

Hi all

I am facing a problem while linking the ShooterGame sample project at this step: “Link UE4Editor-ShooterGameLoadingScreen.dll”.

I am using VS2012, working with UE version 4.6 and the sample project also v4.6

There are two unresolved external symbols which are not found in UE4Editor-Core.dll, both belong to FCoreDelegates.
It seems that the shooter game is looking for symbols with “TBaseDelegate_RetVal_NoParams” while the dll has those symbols only with “TBaseDelegate” (Checked via dependency walker symbols view).

The shooter game is expecting to find symbols:

?GetObjectArrayForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate_RetVal_NoParams@PEAV?$TArray@PEAVUObjectBase@@VFDefaultAllocator@@@@@@anonymous_user_9674a66c
and
?GetSerialNumberBlocksForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate_RetVal_NoParams@PEAPEAPEAH@@anonymous_user_9674a66c

While the UE4Editor-Core.dll has symbols:

?GetObjectArrayForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate@PEAV?$TArray@PEAVUObjectBase@@VFDefaultAllocator@@@■■■$V@@anonymous_user_9674a66c
and
?GetSerialNumberBlocksForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate@PEAPEAPEAH$$$V@@anonymous_user_9674a66c

Only these two symbols are not found, other symbols from the core dll were found as expected.

Has anyone came across such problem?

Below is the exact error from VS2012:

1>ShooterGameLoadingScreen.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: static class TBaseDelegate_RetVal_NoParams *> & __cdecl FCoreDelegates::GetObjectArrayForDebugVisualizersDelegate(void)” (_imp?GetObjectArrayForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate_RetVal_NoParams@PEAV?$TArray@PEAVUObjectBase@@VFDefaultAllocator@@@@@@anonymous_user_9674a66c) referenced in function “void __cdecl dynamic initializer for 'GObjectArrayForDebugVisualizers''(void)" (??__EGObjectArrayForDebugVisualizers@@YAXXZ) 1>ShooterGameLoadingScreen.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class TBaseDelegate_RetVal_NoParams & __cdecl FCoreDelegates::GetSerialNumberBlocksForDebugVisualizersDelegate(void)" (__imp_?GetSerialNumberBlocksForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate_RetVal_NoParams@PEAPEAPEAH@@anonymous_user_9674a66c) referenced in function "void __cdecl dynamic initializer for ‘GSerialNumberBlocksForDebugVisualizers’'(void)” (??__EGSerialNumberBlocksForDebugVisualizers@@YAXXZ)

Hi,

It looks like Shooter Game is looking for a linker symbol from a VS2012 build, but UE4Editor-Core-dll is from a later version of VS. If you feed these symbols into here:

… they come out as follows:

ShooterGame:

public: static class TBaseDelegate_RetVal_NoParams<class TArray<class UObjectBase * __ptr64,class FDefaultAllocator> * __ptr64> & __ptr64 __cdecl FCoreDelegates::GetObjectArrayForDebugVisualizersDelegate(void)

public: static class TBaseDelegate_RetVal_NoParams<int * __ptr64 * __ptr64 * __ptr64> & __ptr64 __cdecl FCoreDelegates::GetSerialNumberBlocksForDebugVisualizersDelegate(void)

Core:

public: static class $V::TBaseDelegate & __ptr64 __cdecl FCoreDelegates::GetObjectArrayForDebugVisualizersDelegate(void)

public: static class $V::TBaseDelegate & __ptr64 __cdecl FCoreDelegates::GetSerialNumberBlocksForDebugVisualizersDelegate(void)

The demangler doesn’t seem to cope quite correctly with variadics - the $V appears to be some special sauce for an empty parameter pack, which then messes up the demangling of the other template arguments - but I think it’s clearly a variadic template symbol, which means the Core DLL was built with VS2013 or later.

So I think your solution is to rebuild UE4Editor-Core.dll in VS2012.

Hope this helps,

Steve

Hi

We actually didn’t build the UE4 locally, but downloaded an already built v4.6 (source + binaries).
I switched to VS2013 and was able to build the ShooterGame with no errors.

Thanks for your help!