question

Sami Tabikh avatar image
Sami Tabikh asked

Unreal build error: inconsistent dll linkage

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

unreal
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi Sami, we are investigating about this issue, any updates we will let you know, thanks.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sami Tabikh avatar image Sami Tabikh commented ·

Please disregard this request. We've found a flaw in our automated build tool that can corrupt the build environment. Sorry for the trouble.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.