# Can't load level sequence in c++?

**URL:** <https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 15, 2019, 5:58pm UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546 "2019-11-15T17:58:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EPG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EPG](https://forums.unrealengine.com/u/EPG)\
**Post date:** [November 15, 2019, 5:58pm UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546/1 "2019-11-15T17:58:05Z")

</div>

I would like to load all my level sequences during gameplay in C++ and do some stuff with all the animations they contain.  
I tried several ways and I keep running into errors like this:

UMovieSceneSequence\* movie= Cast\<UMovieSceneSequence\>(assetData.GetAsset());

Severity Code Description Project File Line Suppression State  
Error LNK2019 unresolved external symbol “\_\_declspec(dllimport) private: static class UClass \* \_\_cdecl UMovieSceneSequence::GetPrivateStaticClass(void)” (\__imp_?GetPrivateStaticClass@UMovieSceneSequence@@CAPEAVUClass@@XZ) referenced in function “public: void \_\_cdecl AnimationPlayer::initialize(class Px::String const &)” (?initialize@AnimationPlayer@@QEAAXAEBVString@Px@@@Z) SWP\_VR D:\svn\SWP\_VR\Intermediate\ProjectFiles\Module.SWP\_VR.1\_of\_3.cpp.obj 1

The same happens for ULevelSequence and also when I write this:

AssetRegistryModule.Get().GetAssetsByClass(ULevelSequence::StaticClass()-\>GetFName(), AssetData);

Any suggestions? I would be grateful for any ideas!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_81c698981](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_81c698981](https://forums.unrealengine.com/u/anonymous_user_81c698981)\
**Post date:** [November 15, 2019, 8:22pm UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546/2 "2019-11-15T20:22:19Z")

</div>

Did you add #include “MovieSceneSequence.h” in the header file?

Error LNK2019 usually refers to a situation where there’s a function declaration, but no definition.

---

<div class="post-metadata">

**Author:** ![EPG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EPG](https://forums.unrealengine.com/u/EPG)\
**Post date:** [November 18, 2019, 8:52am UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546/3 "2019-11-18T08:52:16Z")

</div>

Yes, I have this: **#include "Runtime/MovieScene/Public/MovieSceneSequence.h**

---

<div class="post-metadata">

**Author:** ![EPG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EPG](https://forums.unrealengine.com/u/EPG)\
**Post date:** [November 19, 2019, 11:52am UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546/4 "2019-11-19T11:52:54Z")

</div>

I managed to solve it by modifying the build file:  
PublicDependencyModuleNames.AddRange(new string] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “LevelSequence”, “MovieScene” });

---

<div class="post-metadata">

**Author:** ![Ariel\_Gimenez](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ariel_gimenez/32/591990_2.png) [@Ariel\_Gimenez](https://forums.unrealengine.com/u/Ariel_Gimenez)\
**Post date:** [March 1, 2022, 6:37pm UTC](https://forums.unrealengine.com/t/cant-load-level-sequence-in-c/133546/5 "2022-03-01T18:37:27Z")

</div>

Tutorial en español.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/1/34188435249bf508db42ce4fc8c764e36b425385.jpeg "Unreal Engine C++ cómo usar el level sequence y solucionar problemas de compilación") ](https://www.youtube.com/watch?v=8Mk8PvL3YWw)

Github source code.

> **[GitHub - kone9/Unreal\_engine\_levelSequence\_CPP: Example project using...](https://github.com/kone9/Unreal_engine_levelSequence_CPP)**
>
> Example project using levelSequence from C++. Contribute to kone9/Unreal\_engine\_levelSequence\_CPP development by creating an account on GitHub.

Discussion in another entry I made.

> [@Unreal engine how to put play to a level sequencer from C++ "get an ALevelSequenceActor from the scene in c++"](https://forums.unrealengine.com/t/unreal-engine-how-to-put-play-to-a-level-sequencer-from-c-get-an-alevelsequenceactor-from-the-scene-in-c/502492):
>
> Unreal Engine Version: 4.27.2-18319896+++UE4+Release-4.27 Does anyone know how to include ALevelSequenceActor in a .CPP file, I did not enter the form, it shows me an error… The issue is that I want to handle the levelsequence from C++ but I can’t find a way to include the library. I mean I include it like this. [Screenshot\_5] code: #include \<LevelSequence/Public/LevelSequenceActor.h\> and if i want to do this Error in ALevelSequenceActor::StaticClass(). …
