Forward declaration and circular dependency

Ok, I have an actor-class (ActorClass.h) and a custom component class derived from UActorComponent (CustomComponent.h).

In order to use the component I assume I have to include the library “CustomComponent.h” in the actor-class header file.
In the component class I need to call methods and access variables declared in the actor-class. This can’t be done with forward declaration:

class AActorClass;

Since it’s an incomplete type. But, including “ActorClass.h” in the custom component header file will result in a “circular dependency” compiler error.

What’s the workaround here?

Explained nicely there.

I actually read that doc by rama on epic wiki, but was too lazy and I didn’t read it all. I was missing the #include in .cpp file. Thanks!