# Paper 2D C++: Cannot Open Source PaperCharacter.generated.h

**URL:** <https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222>\
**Category:** Plugins\
**Tags:** unreal-engine, Plugins, CPP, question\
**Created:** [December 22, 2014, 3:31am UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222 "2014-12-22T03:31:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5083a179](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5083a179](https://forums.unrealengine.com/u/anonymous_user_5083a179)\
**Post date:** [December 22, 2014, 3:31am UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/1 "2014-12-22T03:31:41Z")

</div>

So I’ve been trying to mess around with paper 2D, just to get some experience with it, and I have run into several problems trying to write gameplay in C++ using the plugin.

At first I ran into trouble with VS not recognizing “#include PaperCharacter.h”, however, I quickly fixed this by adding the “Paper2D” module to my project.Build.cs file, and updating my VS include search path (Right Click on Your VS Project Name-\>Properties-\>NMake-\>Include Search Path) (I included the paths of Paper2D Classes: C:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes and C:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Public)

My VS now recognizes the PaperCharacter header, and all of the Paper2D Classes are listed under my external dependencies, but I am having a problem building my project still. It appears that VS cannot open the PaperCharacter.generated.h (found in PaperCharacter.h as “#include PaperCharacter.generated.h” ) source file (as noted in error 6-bolded below). I believe that this is causing the majority of my other errors, but I don’t understand why VS cannot seem to load this generated header.

I presently have one class (one header and one source file) called RPGCharacter which extendes APaperCharacter.  
There is currently no code in this source or header file.

My errors are shown below. Any help in resolving this issue would be greatly appreciated.

Errors:   
1 IntelliSense: identifier “FWindSourceSceneProxy” is undefined c:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Classes\Components\WindDirectionalSourceComponent.h 20 2 RPG  
2 IntelliSense: identifier “FOnSelectedLevelsChangedEvent” is undefined c:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1929 2 RPG  
3 IntelliSense: no instance of constructor “FReadSurfaceDataFlags::FReadSurfaceDataFlags” matches the argument list c:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h 55 92 RPG  
4 IntelliSense: no instance of constructor “FReadSurfaceDataFlags::FReadSurfaceDataFlags” matches the argument list c:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h 63 87 RPG  
5 IntelliSense: identifier “FMeshBatchElement” is undefined c:\Program Files\Unreal Engine\4.4\Engine\Source\Runtime\ShaderCore\Public\VertexFactory.h 488 131 RPG  
**6 IntelliSense: cannot open source file “PaperCharacter.generated.h”** c:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes\PaperCharacter.h 5 1 RPG  
7 IntelliSense: expected a ‘;’ c:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes\PaperCharacter.h 10 35 RPG  
8 IntelliSense: a type qualifier is not allowed on a nonmember function c:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes\PaperCharacter.h 26 57 RPG  
9 IntelliSense: expected a declaration c:\Program Files\Unreal Engine\4.6\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes\PaperCharacter.h 27 1 RPG  
10 IntelliSense: “Super” is not a nonstatic data member or base class of class “ARPGCharacter” c:\Users\ \Documents\Unreal Projects\RPG\Source\RPG\RPGCharacter.cpp 8 4 RPG  
11 IntelliSense: not a class or struct name c:\Users\ \Documents\Unreal Projects\RPG\Source\RPG\RPGCharacter.h 13 38 RPG  
**12 IntelliSense: variable “APaperCharacter” is not a type name c:\Users\ \Documents\Unreal Projects\RPG\Source\RPG\RPGCharacter.h** 15 2 RPG

---

<div class="post-metadata">

**Author:** ![Oskarek15\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oskarek15\_1](https://forums.unrealengine.com/u/Oskarek15_1)\
**Post date:** [March 12, 2015, 3:43pm UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/2 "2015-03-12T15:43:53Z")

</div>

Hi,

You have to include D:\Program Files\Epic Games\4.7\Engine\Intermediate\Build\Win64\Inc\Plugins\Paper2D

Be sure to add “Paper2D” to PublicDependencyModuleNames in your build.cs file!

Better late then never!

Cheers,  
Oskar

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c9d866bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c9d866bf](https://forums.unrealengine.com/u/anonymous_user_c9d866bf)\
**Post date:** [March 30, 2015, 1:25am UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/3 "2015-03-30T01:25:54Z")

</div>

Are you sure this is correct? The error expects PaperCharacter.h, but this folder only has PaperCharacter.generated.h. I noticed another folder does have PaperCharacter.h but it doesn’t seem correct to include it. C:\Program Files\Unreal Engine\4.7\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes

---

<div class="post-metadata">

**Author:** ![cart](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cart](https://forums.unrealengine.com/u/cart)\
**Post date:** [April 1, 2015, 8:41am UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/4 "2015-04-01T08:41:37Z")

</div>

I just add `PublicDependencyModuleNames.Add("Paper2D");` in mybuld.cs file,where you construct your class.

instead of include search path,you may try this way!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8ab98422](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8ab98422](https://forums.unrealengine.com/u/anonymous_user_8ab98422)\
**Post date:** [July 11, 2015, 10:59pm UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/5 "2015-07-11T22:59:03Z")

</div>

**Step 1** is **adding “Paper2D” to your Public Dependency Modules** in the Yourgame.Build.cs file like this (do not forget to save the changed file before step 2:

```
PublicDependencyModuleNames.AddRange(
             new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Paper2D" });

```

**Step 2** is **regenerating the Visual Studio project files** to get access to the Paper2D headers and allow linking, with one of these two methods:

- In your game’s UE4 Editor under _File \> Refresh Visual Studio Project_
- In the project folder, right click YourGame.uproject and select _Generate Visual Studio Project Files_

**Step 3** is **including the required Paper2D header files** and start using the classes, even auto cpmplete of the header file names should work now:

```
#include "PaperFlipbookComponent.h"

```

Have fun!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6dbe8be9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6dbe8be9](https://forums.unrealengine.com/u/anonymous_user_6dbe8be9)\
**Post date:** [October 6, 2015, 1:21pm UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/6 "2015-10-06T13:21:24Z")

</div>

Thank you so much - THIS IS THE REAL DEAL GUY. Note, step 2 is very important - didn’t work for me till I rebuilt all binaries.

---

<div class="post-metadata">

**Author:** ![younesouhbi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@younesouhbi](https://forums.unrealengine.com/u/younesouhbi)\
**Post date:** [September 7, 2017, 6:18pm UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/7 "2017-09-07T18:18:02Z")

</div>

I was missing step 2 and it drove me crazy!!!

---

<div class="post-metadata">

**Author:** ![nonameagain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nonameagain](https://forums.unrealengine.com/u/nonameagain)\
**Post date:** [March 18, 2018, 7:35am UTC](https://forums.unrealengine.com/t/paper-2d-c-cannot-open-source-papercharacter-generated-h/302222/8 "2018-03-18T07:35:33Z")

</div>

Thanks. Note that I didn’t need to regenerate the Visual Studio Project Files as the Visual Studio (2017) asked to Reload the file, and it works just fine.
