VS2015 linker errors

UE4.9 release + VS 2015 (gen.project.files with ‘-2015’ option) = some build errors + linker errors.

I’ve fixed the following build errors:

  1. macro IS_POD __is_pod(T) - c4647 behaviour changed. I replaced __is_pod(T) → std::is_pod<< T >>::value in file 4.9\Engine\Source\Runtime\Core\Public\Templates\UnrealTypeTraits.h
  2. warning threated as error was removed from pragma in Engine\Source\Runtime\Core\Public\Windows\WindowsPlatformCompilerSetup.h. There were some errors pointing to standard locale header or smth similar. Error was like 'printf_s(name) should be used as printf_s("%s", name)". c4774
  3. Some c4458 declaration of ‘X’ hides class member errors

See build log below.

Is it UE linker issues with VS2015 or my fault?

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: Polygon4, Configuration: Development_Editor x64 ------
2>  Parsing headers for Polygon4Editor
2>    Running UnrealHeaderTool "H:\Games\Epic Games\Projects\Polygon4\Polygon4.uproject" "H:\Games\Epic Games\Projects\Polygon4\Intermediate\Build\Win64\Polygon4Editor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
2>  Reflection code generated for Polygon4Editor in 12,4748387 seconds
2>  Performing 4 actions (4 in parallel)
2>  Polygon4GameMode.cpp
2>  Polygon4.generated.cpp
2>  Glider.cpp
2>  [4/4] Link UE4Editor-Polygon4.dll
2>     Creating library H:\Games\Epic Games\Projects\Polygon4\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Polygon4.lib and object H:\Games\Epic Games\Projects\Polygon4\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-Polygon4.exp
2>MenuGameMode.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl AGameMode::SetPause(class APlayerController *,class TBaseDelegate<bool>)" (?SetPause@AGameMode@@UEAA_NPEAVAPlayerController@@V?$TBaseDelegate@_N$$V@@@Z)
2>Polygon4GameMode.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl AGameMode::SetPause(class APlayerController *,class TBaseDelegate<bool>)" (?SetPause@AGameMode@@UEAA_NPEAVAPlayerController@@V?$TBaseDelegate@_N$$V@@@Z)
2>Polygon4.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl AGameMode::SetPause(class APlayerController *,class TBaseDelegate<bool>)" (?SetPause@AGameMode@@UEAA_NPEAVAPlayerController@@V?$TBaseDelegate@_N$$V@@@Z)
2>Polygon4.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class TBaseDelegate<class UObjectBase * * *> & __cdecl FCoreDelegates::GetObjectArrayForDebugVisualizersDelegate(void)" (__imp_?GetObjectArrayForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate@PEAPEAPEAVUObjectBase@@$$V@@XZ) referenced in function "void __cdecl `dynamic initializer for 'GObjectArrayForDebugVisualizers''(void)" (??__EGObjectArrayForDebugVisualizers@@YAXXZ)
2>Polygon4.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class TBaseDelegate<int * * *> & __cdecl FCoreDelegates::GetSerialNumberBlocksForDebugVisualizersDelegate(void)" (__imp_?GetSerialNumberBlocksForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate@PEAPEAPEAH$$V@@XZ) referenced in function "void __cdecl `dynamic initializer for 'GSerialNumberBlocksForDebugVisualizers''(void)" (??__EGSerialNumberBlocksForDebugVisualizers@@YAXXZ)
2>MainMenu.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FKey::FKey(struct FKey &&)" (__imp_??0FKey@@QEAA@$$QEAU0@@Z) referenced in function "public: __cdecl FReply::FReply(class FReply &&)" (??0FReply@@QEAA@$$QEAV0@@Z)
2>PauseMenu.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl FKey::FKey(struct FKey &&)" (__imp_??0FKey@@QEAA@$$QEAU0@@Z)
2>ModListView.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl FKey::FKey(struct FKey &&)" (__imp_??0FKey@@QEAA@$$QEAU0@@Z)
2>MainMenu.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FSlateColor::FSlateColor(struct FSlateColor &&)" (__imp_??0FSlateColor@@QEAA@$$QEAU0@@Z) referenced in function "public: struct FSlateColor __cdecl TMemberFunctionCaller<class STableRow<class TSharedPtr<class polygon4::Modification,0> >,struct FSlateColor (__cdecl STableRow<class TSharedPtr<class polygon4::Modification,0> >::*)(void)const >::operator()<>(void)" (??$?R$$V@?$TMemberFunctionCaller@V?$STableRow@V?$TSharedPtr@VModification@polygon4@@$0A@@@@@P81@EBA?AUFSlateColor@@XZ@@QEAA?AUFSlateColor@@XZ)
2>ModListView.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl FSlateColor::FSlateColor(struct FSlateColor &&)" (__imp_??0FSlateColor@@QEAA@$$QEAU0@@Z)
2>MainMenu.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct FSlateColor & __cdecl FSlateColor::operator=(struct FSlateColor &&)" (__imp_??4FSlateColor@@QEAAAEAU0@$$QEAU0@@Z) referenced in function "public: class TAttribute<struct FSlateColor> & __cdecl TAttribute<struct FSlateColor>::operator=(class TAttribute<struct FSlateColor> &&)" (??4?$TAttribute@UFSlateColor@@@@QEAAAEAV0@$$QEAV0@@Z)
2>ModListView.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: struct FSlateColor & __cdecl FSlateColor::operator=(struct FSlateColor &&)" (__imp_??4FSlateColor@@QEAAAEAU0@$$QEAU0@@Z)
2>H:\Games\Epic Games\Projects\Polygon4\Binaries\Win64\UE4Editor-Polygon4.dll : fatal error LNK1120: 6 unresolved externals
2>  -------- End Detailed Actions Stats -----------------------------------------------------------
2>ERROR : UBT error : Failed to produce item: H:\Games\Epic Games\Projects\Polygon4\Binaries\Win64\UE4Editor-Polygon4.dll
2>  Total build time: 19,75 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""H:\Games\Epic Games\4.9\Engine\Build\BatchFiles\Build.bat" Polygon4Editor Win64 Development "H:\Games\Epic Games\Projects\Polygon4\Polygon4.uproject" -rocket -2015" exited with code -1.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I’m building my project while 4.9 was downloaded from Launcher, so engine is prebuilt.
I those comments, so it seems I’m using 8.1 Windows SDK (while I’m on Win10), but this probably is not an issue.

It is possible that there is inconsistency between VS2013 object files (e.g. .lib s) linked into VS2015 binaries (.dll). I.e. different CRTs. BUT we see unreal symbol errors, not crt.

Hey -

Did you receive these errors when building the 4.9 engine or when building a project in 4.9? Did you check the release notes for VS2015 compatibility in 4.9 (Unreal Engine 4.9 Released! - Announcements - Epic Developer Community Forums! - In the “Programming” section just above “Rendering” in the first post).

Cheers

After enabling Windows10 SDK, do you still receive errors when building the project? You may want to wait for 4.9 to finish downloading before trying to build the project.

How can I enable ‘WindowsPlatform.bUseWindowsSDK10’ ?

Sorry. I think I found the right place.
4.9\Engine\Programs\UnrealBuildTool\BuildConfiguration.xml
Testing now.

Ok, same linker errors on Win10 SDK.

Oops. It looks like the Engine or UBT resets 4.9\Engine\Programs\UnrealBuildTool\BuildConfiguration.xml after my changes. The question is still open: how to set ‘WindowsPlatform.bUseWindowsSDK10’?

Hi ,

Are you trying to use Visual Studio 2015 with the binary version of 4.9 that is installed by the Launcher? If so, that will not work. Support for Visual Studio 2015 is only partially implemented in 4.9, and is only available when the Engine is built from source code. It is also still considered to be in Beta at this time.

I will see if I can gather some more information related to using Windows 10 with 4.9.

I see. Yes I’m trying to use prebuilt 4.9 binaries from Launcher while compiling my project in VS2015. Ok then, I’ll wait for official VS2015 support.