AActor *UactorComponent::GetOwner const - pointer to incomplete class type is not allowed

Hi guys, I am trying to follow along the video tutorial and am now trying to call the GetName function on the Pointer to the AActor retrieved through GetObject().

However, as soon as I type “GetObject()->” no autocomplete pops up (as it does in the video) and when I add “GetName()” manually, I get the compiler error “pointer to incomplete class type is not allowed”.

What am doing wrong? Am I missing an import or so? I already compared my code to Ben’s git repo but can’t find any differences. I am on unreal editor 4.16.0!



I found some information that states this is a problem with 4.16.0 (I am using this as well). This is an intellisense issue, the code should still compile.


1 Like

That is correct, and I found a solution over here: https://answers.unrealengine.com/questions/604985/getowner-not-autocompleting.html

Bottom line: Add #include “Engine.h” to your cpp-file, and it works like a charm.


Hey there!
Thanks for the solution ! I was starting to get serious headaches about that.

  • Lucas -

Just came across this issue also, compiles and works (shows the 2 different names), the error was bugging me though.

These forums are a great asset to go along with the course :slight_smile:

Thanks! Just ran into the same thing here with 4.16

Another big THANK YOU!!! For this solution. It was driving me nuts.

Thankyou… you are awesome… i was thinking to leave unreal and go back to unity bcz of this error

Privacy & Terms