Can't #include "PaperSpriteComponent.h"

Hi everyone, I’m having some problem in trying to #include “PaperSpriteComponent.h”

I’ve added in my .Build.cs file as you can see in the line below



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


and succesfully recompiled the solution.

But then when I go and try to #include “PaperSpriteComponent.h” in my class, the line is underlined in red because the file is not seen.

Why is it not working? :confused:

Try #include “Paper2D/PaperSpriteComponent.h”

You may also need to add Paper2D to your PrivateDependencyModuleNames in your Build.cs since that class is in the “Private” folder.

I added it to PrivateDependencyModuleNames but I can’t #include “Paper2D/PaperSpriteComponent.h” because there is no Paper2D folder (according to visual studio intellisense)

Well, I’ve found a copy under #include “…/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperSpriteComponent.h” which is a horrible line to write, anyway it compile succesfully this way while declaring a UPaperSpriteComponent* , though VisualStudio keep underlying the UPaperSpriteComponent* with a red line…should I ignore it? Is this actually working? :S

I have youtube video mention about paper2D. its one of comments mentioned about included path. check it.

1 Like

I see, though I am not quite sure how to add those to the included paths, I’m a begginner :stuck_out_tongue:

if your project is C++, open visual studio. Go to Project -> your project name’s Properties -> NMake -> IncludePath (click Edit) and it will open paths. drag to the end, at empty space, put those included path.

I think you are from Japan, thus Visual studio might show with Japanese.

2 Likes

Thanks a lot Marjane, a new thing learned :smiley:
I tricked you by the way, I’m not from Japan xD Just studying some Japanese as hobby third language :slight_smile:

Go to Project -> your project name’s Properties -> NMake -> IncludePath (click Edit) and it will open paths.

im having this same issue, now i no longer get the cannot open the .h file but i get "E1696 cannot open source file “PaperCharacter.generated.h”. Even though its in the directory that i included in the NMake.