Download

Pointer syntax error on [UCameraComponent* name;] statement

Hello, so i have a header file and inside it i’m trying to set up a pointer of type UCameraComponent as a data member, but when i attempt to compile i get the following error:


Error c:\..\fpsproject\source\fpsproject\FPSCharacter.h(47) : error C2143: syntax error: missing ';' before '*'

This is the code causing the error.



UPROPERTY(VisibleAnywhere)
UCameraComponent* FPSCameraComponent;   //Actual line 47


I get the same error when trying to make a pointer of type UTextRenderComponent


UTextRenderComponent* CountdownText;

But not when making a pointer of type UParticleSystemComponent


UParticleSystemComponent* OurParticleSystem;

BTW, all of this statements i’m getting from the official docs tutorials. Any ideas on what am i doing wrong? thanks in advance

If I’m not mistaken Epic excluded a lot of components from basic includes in 4.15 and now you must include manually what you want to use.


#include "Components/TextRenderComponent.h"

Oh man, thank you so much! i owe you one :]