Error when i use #include

Hi everyone! When I enter the #include Gameframework/Actor.h I get an error on that line. I use Unreal engine 4.18.1. I have tried to enter .cpp instead of .h at the end. I have tried to enter the #include Gameframework in the header file and it still doesn’t work.

screenshot:

You have to type it like #include <Gameframework/Actor.h>

I put “” around it instead of <> which worked for me to autocomplete.

I had the same problem on unreal 4.20.1 when I added #include “GameFramework/Actor.h”
A google search led me to also add #include “Engine.h” and that fixed my errors and the build was successful. hope that helps anyone with this issue.

Edit: Upon further investigation I found the error came when I added “GameFramework/Actor.h” to PositionReport.h and went away when instead I added it to PositionReport.cpp. So I put it there and got rid of #include “Engine.h”

1 Like

This advice was spot on, I’m using 4.20.3 and it works just fine.

Hello All,

Complete beginner here, I went through the bull cow thing 3 times lol and now I thought it was time to move on to this section.

I am having a similar issue, when I add
#include “GameFramework/Actor.h”
to the top of the PositionReport.h File a bunch of things seem to break! ( I also added it with the <> this didn’t work )

Do I have a typo… missing ; or even worst missing () grrr!
here are some screen shots of what I am looking at. Any help would be appreciated !!

note: using Unreal Engine 4.20.3 and Visual studio 2017

Hello, I tried adding it to the .h and the .cpp I still have the issue…

Unreal 4.26 here. Visual Studio 2019 autocompletes to "Actor.h" instead of "GameFramework/Actor.h"

Privacy & Terms