Hello,
When I try building our Unreal game with PlayFab I get lots of these errors:
r:\next\CodeProjects\PlayFabHost\Plugins\PlayFab\Source\PlayFab\Private\PlayFabAdminAPI.cpp(15): error C4273: 'PlayFab::UPlayFabAdminAPI::UPlayFabAdminAPI': inconsistent dll linkage r:\next\CodeProjects\PlayFabHost\Plugins\PlayFab\Source\PlayFabCpp\Public\Core/PlayFabAdminAPI.h(132): note: see previous definition of '{ctor}'
What I see happening is that when the PlayFab module is built the PlayFabCommon and PlayFabCpp modules' classes are given the attribute DLLIMPORT but when those modules are built their classes get the attribute DLLEXPORT.
This happens because the UnrealBuildTool puts the {module_name}_API macro in the PCH file for the module being built so for example PLAYFABCOMMON_API in PCH.PlayFab.h is DLLIMPORT but in PCH.PlayFabCommon.h it is DLLEXPORT.
We're using Unreal 4.21 which requires explicit PCH files so perhaps that's why this hasn't been a problem before.
How can we get around this? Should we combine PlayFab, PlayFabCommon and PlayFabCpp into a single module? Is there magic module rule to fix this?
Please advise, thanks.
Sami Tabikh