# LNK2019 error when compile static function declared in engine plugin

**URL:** <https://forums.unrealengine.com/t/lnk2019-error-when-compile-static-function-declared-in-engine-plugin/1901881>\
**Category:** C++\
**Tags:** c-c, c-class-wizard, c-and-bluepri, lnk2019, c-custommeshcomponen, c-and-blueprint, c-error, c-class, build, c-custom-shape, c-programming, c-cone-shape, unreal-engine, CPP\
**Created:** [June 13, 2024, 3:27pm UTC](https://forums.unrealengine.com/t/lnk2019-error-when-compile-static-function-declared-in-engine-plugin/1901881 "2024-06-13T15:27:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwsstt1994](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wwsstt1994/32/905776_2.png) [@wwsstt1994](https://forums.unrealengine.com/u/wwsstt1994)\
**Post date:** [June 13, 2024, 3:27pm UTC](https://forums.unrealengine.com/t/lnk2019-error-when-compile-static-function-declared-in-engine-plugin/1901881/1 "2024-06-13T15:27:12Z")

</div>

**Source code:**

```auto
if (UShowLoginUICallbackProxy* LoginProxy = UShowLoginUICallbackProxy::ShowExternalLoginUI(this, UGameplayStatics::GetPlayerController(this, 0)))
{
	LoginProxy->OnSuccess.AddDynamic(this, &AMainMenuGameMode::OnShowLoginProxySuccess);
	LoginProxy->OnFailure.AddDynamic(this, &AMainMenuGameMode::OnShowLoginProxyFailure);
	LoginProxy->Activate();
}

```

**Compile error:**

0\>MainMenuGameMode.cpp.obj: Error : LNK2019: 无法解析的外部符号 “public: static class UShowLoginUICallbackProxy \* \_\_cdecl UShowLoginUICallbackProxy::ShowExternalLoginUI(class UObject \*,class APlayerController \*)” (?ShowExternalLoginUI@UShowLoginUICallbackProxy@@SAPEAV1@PEAVUObject@@PEAVAPlayerController@@@Z)，函数 “public: virtual void \_\_cdecl AMainMenuGameMode::BeginPlay(void)” (?BeginPlay@AMainMenuGameMode@@UEAAXXZ) 中引用了该符号  
0\>UnrealEditor-CropoutCpp.dll: Error : LNK1120: 1 个无法解析的外部命令

I enabled plugin in my editor, and added the module name “OnlineSubsystemUtils” in my build.cs, but not resolved ☹  
I found that this error only occurs to static functions.  
Has anyone resolved this?

---

<div class="post-metadata">

**Author:** ![zeaf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeaf/32/1108035_2.png) [@zeaf](https://forums.unrealengine.com/u/zeaf)\
**Post date:** [June 13, 2024, 6:08pm UTC](https://forums.unrealengine.com/t/lnk2019-error-when-compile-static-function-declared-in-engine-plugin/1901881/2 "2024-06-13T18:08:57Z")

</div>

`UShowLoginUICallbackProxy` has the MinimalAPI specifier, so I don’t think you can use its functions in other modules

Since this is supposed to be a blueprint async task, which are generally not used in code, since you have access to the underlying code, I would suggest binding to the same events as in `UShowLoginUICallbackProxy::Activate()`

GetOnlineSubystem → GetExternalUIInterface → ShowLoginUI

You don’t need much more, if ShowLoginUI returns false you should call your failure function, otherwise it should eventually call Success

Perhaps you also need to do something similar to what’s done in `UShowLoginUICallbackProxy::OnShowLoginUICompleted`

---

<div class="post-metadata">

**Author:** ![wwsstt1994](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wwsstt1994/32/905776_2.png) [@wwsstt1994](https://forums.unrealengine.com/u/wwsstt1994)\
**Post date:** [June 14, 2024, 1:44am UTC](https://forums.unrealengine.com/t/lnk2019-error-when-compile-static-function-declared-in-engine-plugin/1901881/3 "2024-06-14T01:44:46Z")

</div>

Thank you so mush, I’ll try the way you taught, have a nice day 🙂
