# Linker error using UWidgetAnimation::BindToAnimationFinished

**URL:** <https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984>\
**Category:** UI\
**Tags:** linker, unreal-engine, question, UMG\
**Created:** [March 9, 2021, 3:02pm UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984 "2021-03-09T15:02:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fraps2020](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fraps2020/32/460865_2.png) [@Fraps2020](https://forums.unrealengine.com/u/Fraps2020)\
**Post date:** [March 9, 2021, 3:02pm UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984/1 "2021-03-09T15:02:28Z")

</div>

Hi,

I’m really bugged by a LNK2019 happening trying to use UWidgetAnimation::BindToAnimationFinished.

I do have the UMG modules specified in my Build.cs:

```
public class Theseus : ModuleRules
{
	public Theseus(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });
		PublicDependencyModuleNames.AddRange(new string[] { "UMG", "Slate", "SlateCore" });
		PrivateDependencyModuleNames.AddRange(new string[] { "GameplayTasks", "AIModule", "NavigationSystem" });
		PrivateDependencyModuleNames.AddRange(new string[] { "Niagara" });
	}
}

```

I do have the right includes in my widget class (derived from UUserWidget):

```
#include "Animation/WidgetAnimation.h"
#include "Blueprint/UserWidget.h"

```

And this is how I’m trying to bind a UFUNCTION with BindToAnimationFinished:

```
FWidgetAnimationDynamicEvent MyAnimationEvent;
MyAnimationEvent.BindDynamic(this, &UWidgetInventory::BindingTest);
GetAnimationByName(TEXT("FadeOutMessages"))->BindToAnimationFinished(this, MyAnimationEvent);

```

However, no matter how I clean my build and rebuild, this is what I get:

```
error LNK2019: unresolved external symbol "public: void __cdecl UWidgetAnimation::BindToAnimationFinished(class UUserWidget *,class FWidgetAnimationDynamicEvent)" (?BindToAnimationFinished@UWidgetAnimation@@QEAAXPEAVUUserWidget@@VFWidgetAnimationDynamicEvent@@@Z) referenced in function "protected: virtual void__cdecl UWidgetInventory::NativeConstruct(void)" (?NativeConstruct@UWidgetInventory@@MEAAXXZ)

```

I’ve also tried to use a plain pointer to a specified UWidgetAnimation (ie. not a pointer returned by my function GetAnimationByName) to no avail.

I beg your help, this is driving me crazy!

Thank you,

f

---

<div class="post-metadata">

**Author:** ![StudyingReflection](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/studyingreflection/32/88710_2.png) [@StudyingReflection](https://forums.unrealengine.com/u/StudyingReflection)\
**Post date:** [April 3, 2021, 7:51am UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984/2 "2021-04-03T07:51:42Z")

</div>

The WidgetAnimation.h not have UMG\_API in class or function(BindToAnimationFinished).

---

<div class="post-metadata">

**Author:** ![StudyingReflection](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/studyingreflection/32/88710_2.png) [@StudyingReflection](https://forums.unrealengine.com/u/StudyingReflection)\
**Post date:** [April 3, 2021, 7:51am UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984/3 "2021-04-03T07:51:45Z")

</div>

so, You can not Use It In Your Source Module, Only Change It.

---

<div class="post-metadata">

**Author:** ![StudyingReflection](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/studyingreflection/32/88710_2.png) [@StudyingReflection](https://forums.unrealengine.com/u/StudyingReflection)\
**Post date:** [April 3, 2021, 7:51am UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984/4 "2021-04-03T07:51:50Z")

</div>

try  
class UMG\_API UWidgetAnimation : public UMovieSceneSequence  
or  
UMG\_API void BindToAnimationStarted(UUserWidget\* Widget, FWidgetAnimationDynamicEvent Delegate);

---

<div class="post-metadata">

**Author:** ![spaceindaver](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/spaceindaver/32/88708_2.png) [@spaceindaver](https://forums.unrealengine.com/u/spaceindaver)\
**Post date:** [October 5, 2022, 3:23pm UTC](https://forums.unrealengine.com/t/linker-error-using-uwidgetanimation-bindtoanimationfinished/479984/5 "2022-10-05T15:23:50Z")

</div>

I ran into the same issue and ended up here.

Looks like `UWidgetAnimation::BindToAnimationFinished` is explicitly not exported from the UMG module. However, `UUserWidget::BindToAnimationFinished` is. My guess is they want to use the User Widget wrapper instead of going directly to the WidgetAnimation version of that function.

Assuming you have “UMG” added to your module dependencies, this should fix the issue for you if the code is in a UUserWidget derived class:

```auto
FWidgetAnimationDynamicEvent MyAnimationEvent;
MyAnimationEvent.BindDynamic(this, &UWidgetInventory::BindingTest);
BindToAnimationFinished(GetAnimationByName(TEXT("FadeOutMessages")), MyAnimationEvent);

```
