# How to include and use UPlayMontageCallbackProxy::CreateProxyObjectForPlayMontage in C++?

**URL:** <https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770>\
**Category:** C++\
**Tags:** include, build, unreal-engine, question, CPP\
**Created:** [October 31, 2023, 7:09am UTC](https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770 "2023-10-31T07:09:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brain56](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brain56](https://forums.unrealengine.com/u/brain56)\
**Post date:** [October 31, 2023, 7:09am UTC](https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770/1 "2023-10-31T07:09:47Z")

</div>

I want to play my `UAnimMontage` via C++, and in particular, want to make use of the conveniences of UPlayMontageCallbackProxy.

Looks like in theory, I can use `UPlayMontageCallbackProxy::CreateProxyObjectForPlayMontage`, but anytime I use it, I just get linker errors:

`0>YCharacterVaulting.cpp.obj: Error LNK2019 : unresolved external symbol "public: void __cdecl UPlayMontageCallbackProxy::PlayMontage(class USkeletalMeshComponent *,class UAnimMontage *,float,float,class FName)" (?PlayMontage@UPlayMontageCallbackProxy@@QEAAXPEAVUSkeletalMeshComponent@@PEAVUAnimMontage@@MMVFName@@@Z) referenced in function "public: void__cdecl UYCharacterVaulting::Traverse(void)" (?Traverse@UYCharacterVaulting@@QEAAXXZ)`

I’ve already updated my Build.cs so that the module is included:

` PrivateDependencyModuleNames.AddRange(new string[] {"AnimGraphRuntime", "MotionWarping"});`

Any ideas on how I can fix the linker error? Thank you!

---

<div class="post-metadata">

**Author:** ![Berkay\_Tuna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Berkay\_Tuna](https://forums.unrealengine.com/u/Berkay_Tuna)\
**Post date:** [April 5, 2024, 3:20pm UTC](https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770/3 "2024-04-05T15:20:04Z")

</div>

PublicDependencyModuleNames.AddRange(new string[] { “AnimGraphRuntime” });

---

<div class="post-metadata">

**Author:** ![TeryKnop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TeryKnop](https://forums.unrealengine.com/u/TeryKnop)\
**Post date:** [June 24, 2024, 11:26am UTC](https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770/4 "2024-06-24T11:26:09Z")

</div>

Hi,  
I’ve faced the same issue with the same class. My project was compiled successfully but there was that type of linker error in VC 2022. Apart from regural UE set ups for new modules(.Build.cs or ,Target.cs), make sure that Visual Studio sees your include files. `Right click on your project -> Properties`, under `Configuration Properties` find `VC++ Directories -> General -> Include directories`. Make sure there is file path with your .h included. If not, then add it. Then Apply, OK.

I hope it helps somobody.

---

<div class="post-metadata">

**Author:** ![dariac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dariac](https://forums.unrealengine.com/u/dariac)\
**Post date:** [January 15, 2025, 10:31am UTC](https://forums.unrealengine.com/t/how-to-include-and-use-uplaymontagecallbackproxy-createproxyobjectforplaymontage-in-c/1353770/5 "2025-01-15T10:31:05Z")

</div>

Thanks to @Berkay_Tuna, this fixed my compile errors and thanks to @TeryKnop, the error “cannot open source file PlayMontageCallbackProxy.h” was pretty annoying even though the project compiled successfully! Now it’s error free 🙂
