Pointer to incomplete class type is not allowed

It seems that after cutting out the public sections of the base class, I got an error of “pointer to incomplete class type is not allowed” with both the BaseMesh and TurretMesh pointers on these lines in PawnBase.cpp:


and another error of "argument of type “UStaticMeshComponent *” is incompatible with parameter of type “USceneComponent *” for the following line:


I don’t know why this would be the case since no code related to these classes seems to have moved, but adding

#include "Components/StaticMeshComponent.h"

seems to fix it. Any ideas why this is?

Because you need the #include for this code. Try compiling without the the required #includes, and you will get errors like this.
For more info, see this link -

Thanks for the link. I was bothered by the fact that the instructor did not have these #includes, which made me think something else was going on. But it seems that your explanation of precompiled headers from transitive dependencies may be at play on the author’s machine, and my machine was just being vocal about it.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms