Hi I’m new on Unreal Engine 4, I follow a tutorial for create a game, and I have this kind of error on this AActor * GetOwner (); and the error is “error: use of undeclared identifier ‘GetOwner’”.
I tried to include “Runtime/Engine/Classes/GameFramework/Actor.h” but it’s no use.
So if you know how you can fix this it’s will be great.
but i think this isnt your problem, what kind of class is this? i mean did you inherited from AActor?
Because this error: error: use of undeclared identifier ‘GetOwner’ means your class does not have GetOwner function.
Technically only Actors and Actorcomponents have owner So if this is some kind of blueprintfunction library or native c++ class without inheriting it from Actor or Component, GetOwner would not work.
You’re getting that error because GetOwner is not a static nor global scope function. However, since your function is static, you’re pretty much trying to use GetOwner as if it would be a static or global scope function. You have to call that function on valid instance of ActorComponent.
If you can’t make that function non-static, then you’d have to provide a reference to ActorComponent via function parameters.