# Including Header from Private folder?

**URL:** <https://forums.unrealengine.com/t/including-header-from-private-folder/68880>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 13, 2016, 2:58pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880 "2016-07-13T14:58:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [July 13, 2016, 2:58pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/1 "2016-07-13T14:58:36Z")

</div>

I am trying to write a simple function that starts the record of the Sequence recorder.

This exists, in the Editor code, here:

```auto

C:\Program Files\Epic Games\4.12\Engine\Source\Editor\SequenceRecorder\Private\SequenceRecorderBlueprintLibrary.cpp

```

The function is:

```auto

#include "SequenceRecorderPrivatePCH.h"
#include "SequenceRecorderBlueprintLibrary.h"
#include "SequenceRecorder.h"  

void USequenceRecorderBlueprintLibrary::StartRecordingSequence(const TArray<AActor*>& ActorsToRecord)
{
	FSequenceRecorder::Get().ClearQueuedRecordings();
	for(AActor* Actor : ActorsToRecord)
	{
		FSequenceRecorder::Get().AddNewQueuedRecording(Actor);
	}
	
	FSequenceRecorder::Get().StartRecording();
}

```

So, in my code, i have:

```auto

include "Editor/SequenceRecorder/Private/SequenceRecorder.h"

void UrecordTools::StartRecordz(AActor* recordtarget)
{
	TArray<AActor*> ActorsToRecord;

	ActorsToRecord.Add(recordtarget);

	FSequenceRecorder::Get().ClearQueuedRecordings();
	for (AActor* Actor : ActorsToRecord)
	{
		FSequenceRecorder::Get().AddNewQueuedRecording(Actor);
	}

	FSequenceRecorder::Get().StartRecording();

}

```

This will not compile, giving an error in: SequenceRecorder.h

```auto

Cannot open include file: 'MovieSceneAnimationSectionRecorder.h': No such file or directory

```

Is this because it is a private header and I am including it in another class? How can I get around this? (I have included every module I can think of in my Build.cs, and added the path to the headers )

---

<div class="post-metadata">

**Author:** ![Jackblue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jackblue/32/88706_2.png) [@Jackblue](https://forums.unrealengine.com/u/Jackblue)\
**Post date:** [July 13, 2016, 11:50pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/2 "2016-07-13T23:50:56Z")

</div>

On your Plugin\_name.build.cs, you simple need to add the name of your module inside the string array of PublicDependencyModuleNames like this:

```auto

PublicDependencyModuleNames.AddRange(new string] { /*..other module or empty*/ "SequenceRecorder" });

```

And you include header on your code

```auto

#include "SequenceRecorder.h"

```

I hope this help you ! 🙂

P.S: Wiki about plugin creation [here](https://wiki.unrealengine.com/An_Introduction_to_UE4_Plugins)

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [July 14, 2016, 8:59am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/3 "2016-07-14T08:59:59Z")

</div>

I had that module, and that include, already linked. But I needed to add:

```auto

#include "IMovieSceneModule.h"
#include "IMovieSceneSectionRecorder.h"
#include "IMovieSceneSectionRecorderFactory.h"

```

and:

```auto

 "MovieScene", "MovieSceneTracks",

```

to the modules in Build.cs.

Now I get no linking errors, BUT… When I use any code from the SequenceRecorder Module, I get unresolved external symbols…

```auto

PublicDependencyModuleNames.AddRange(new string] { "SequenceRecorder","Core",
                    "CoreUObject",
                    "InputCore",
                    "Engine",
                    "UnrealEd",
                    "EditorStyle",
                    "LevelEditor",
                    "MovieScene",
                    "MovieSceneTracks",
                    "LevelSequence",
                    "CinematicCamera", "Sequencer",});

```

```auto

#include "Editor.h"
#include "LevelSequence.h" 
#include "IMovieSceneModule.h"
#include "IMovieSceneSectionRecorder.h"
#include "IMovieSceneSectionRecorderFactory.h"
#include "Runtime/Engine/Classes/Animation/AnimationRecordingSettings.h"
#include "ISequenceRecorder.h"
#include "SequenceRecorder.h"
#include "SequenceRecorderBlueprintLibrary.h"
#include "SequenceRecorder.h"
#include "ActorRecording.h"
#include "SequenceRecorderUtils.h"
#include "SequenceRecorderSettings.h"

void UrecordTools::StartRecordz()
{
	
	FSequenceRecorder::Get().ClearQueuedRecordings();
	
}

```

gives:

```auto

unresolved external symbol "public: static struct FSequenceRecorder & __cdecl FSequenceRecorder::Get(void)" (?Get@FSequenceRecorder@@SAAEAU1@XZ) referenced in function "public: static void__cdecl UrecordTools::StartRecordz(class AActor *)" (?StartRecordz@UrecordTools@@SAXPEAVAActor@@@Z)	

unresolved external symbol "public: void __cdecl FSequenceRecorder::ClearQueuedRecordings(void)" (?ClearQueuedRecordings@FSequenceRecorder@@QEAAXXZ) referenced in function "public: static void__cdecl UrecordTools::StartRecordz(class AActor *)" (?StartRecordz@UrecordTools@@SAXPEAVAActor@@@Z)	

```

It seems like I am still missing a Module, right?  
Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Cultrarius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cultrarius](https://forums.unrealengine.com/u/Cultrarius)\
**Post date:** [July 15, 2016, 8:30am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/4 "2016-07-15T08:30:26Z")

</div>

Not all functions are exported from a module. That means that sometimes you have to implement those functions yourself.

You should look if the missing functions are actually exported from the module (they should have a macro like ENGINE\_API or MinimalAPI in the class/function signature).

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [July 15, 2016, 10:55am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/5 "2016-07-15T10:55:18Z")

</div>

Ah I see. That would make sense. The approach, as above, calls a struct:

```auto

struct FSequenceRecorder
{
public:
	static FName MovieScenePropertyRecorderFactoryName;

	/** Singleton accessor */
	static FSequenceRecorder& Get();

void ClearQueuedRecordings();

//more things

};

```

from

```auto

c:\Program Files\Epic Games\4.12\Engine\Source\Editor\SequenceRecorder\Private\SequenceRecorder.h

```

The function I copied the code from comes from USequenceRecorderBlueprintLibrary , and the header file class declaration is:

```auto

class SEQUENCERECORDER_API USequenceRecorderBlueprintLibrary : public UBlueprintFunctionLibrary

```

Does this mean it would not export? Is there a way to access a different API class?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Cultrarius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cultrarius](https://forums.unrealengine.com/u/Cultrarius)\
**Post date:** [July 15, 2016, 1:59pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/6 "2016-07-15T13:59:14Z")

</div>

> [@antithing;565133](#):
>
> Ah I see. That would make sense. The approach, as above, calls a struct:  
> The function I copied the code from comes from USequenceRecorderBlueprintLibrary , and the header file class declaration is:
> 
> ```auto
> 
> class SEQUENCERECORDER_API USequenceRecorderBlueprintLibrary : public UBlueprintFunctionLibrary
> 
> ```
> 
> Does this mean it would not export? Is there a way to access a different API class?

The SEQUENCERECORDER\_API means that all public methods from USequenceRecorderBlueprintLibrary are exported from the module, so you may call them from your own module.  
Since the FSequenceRecorder class does not expose its methods you are not able to call them directly.

They already put the SequenceRecorder.h in their “Private” folder, so they do not want you to directly access it because it is not part of the module’s API.  
If you are desperate you can of course edit the engine code and add the SEQUENCERECORDER\_API tags yourself, then your code should compile.

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [July 15, 2016, 2:49pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/7 "2016-07-15T14:49:47Z")

</div>

Ok, thank you again.

So the method:

```auto

UCLASS()
class SEQUENCERECORDER_API USequenceRecorderBlueprintLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

	/** 
	 * Start recording the passed-in actors to a level sequence.
	 * @param	ActorsToRecord	The actors to record
	 */

public:
	UFUNCTION(BlueprintCallable, Category="Sequence Recording")
	static void StartRecordingSequence(const TArray<AActor*>& ActorsToRecord);

};

```

Should be accessible?

I am calling it with:

```auto

void UrecordTools::StartRecordz(AActor* recordtarget)
{
	TArray<AActor*> ActorsToRecord;

	ActorsToRecord.Add(recordtarget);

	USequenceRecorderBlueprintLibrary::StartRecordingSequence(ActorsToRecord);
}

```

And it gives me:

```auto

unresolved external symbol "__declspec(dllimport) public: static void__cdecl USequenceRecorderBlueprintLibrary::StartRecordingSequence(class TArray<class AActor *,class FDefaultAllocator> const &)" (__imp_?StartRecordingSequence@USequenceRecorderBlueprintLibrary@@SAXAEBV?$TArray@PEAVAActor@@VFDefaultAllocator@@@@@Z) referenced in function "public: static void__cdecl UrecordTools::StartRecordz(class AActor *)" (?StartRecordz@UrecordTools@@SAXPEAVAActor@@@Z)	

```

…as above, I have:

```auto

PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject",
                    "Engine",
                    "UnrealEd",
                    "MovieScene",
                    "MovieSceneTracks","SequenceRecorder"
                   });

```

---

<div class="post-metadata">

**Author:** ![ExtraLifeMatt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extralifematt/32/918695_2.png) [@ExtraLifeMatt](https://forums.unrealengine.com/u/ExtraLifeMatt)\
**Post date:** [July 15, 2016, 4:16pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/8 "2016-07-15T16:16:57Z")

</div>

If you edit the engine files, you need to rebuild the UE4 solution (from Git hub) and not just your own project solution. You’ll also need to make sure you regenerate your project solution after you recompile everything engine side.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [July 15, 2016, 4:31pm UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/9 "2016-07-15T16:31:20Z")

</div>

Separately: I assume that what you want to run will only be used by people in the editor?  
Anything from the editor that you reference, will not be available to players at runtime.  
Also: There’s a reason the header is in the “Private” directory …

---

<div class="post-metadata">

**Author:** ![Cultrarius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cultrarius](https://forums.unrealengine.com/u/Cultrarius)\
**Post date:** [July 17, 2016, 8:18am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/10 "2016-07-17T08:18:42Z")

</div>

That is strange, from what you posted the StartRecordingSequence method should be accessible.  
This kind of thing is exactly why I dislike the Unreal Build system.

---

<div class="post-metadata">

**Author:** ![Syedhs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syedhs](https://forums.unrealengine.com/u/Syedhs)\
**Post date:** [July 17, 2016, 10:14am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/11 "2016-07-17T10:14:15Z")

</div>

Yes there is a reason whey they are at private sections… they are meant to be used within Unreal only, and the classes are not exported to others (dlls, exes) to use.

---

<div class="post-metadata">

**Author:** ![Cultrarius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cultrarius](https://forums.unrealengine.com/u/Cultrarius)\
**Post date:** [July 18, 2016, 7:57am UTC](https://forums.unrealengine.com/t/including-header-from-private-folder/68880/12 "2016-07-18T07:57:13Z")

</div>

> [@Syed;565980](#):
>
> Yes there is a reason whey they are at private sections… they are meant to be used within Unreal only, and the classes are not exported to others (dlls, exes) to use.

But if it is marked with SEQUENCERECORDER\_API then it is meant to be exported and used by other modules.
