C++ Custom Viewport errors

Why do I keeping errors when with variables from SEditorViewport and or even FAdvancedPreviewScene.


void SLearningPluginViewport::RefreshViewport()
	// Invalidate the viewport's display.
	SceneViewport->Invalidate(); // <------ pointer to incomplete class type is not allowed

void SStaticMeshEditorViewport::RefreshViewport()
	// Invalidate the viewport's display.

there the same thing i have added the header files and my class is derived from SEditorViewport

class SLearningPluginViewport : public  SEditorViewport, public FGCObject, public ICommonEditorViewportToolbarInfoProvider

also with FAdvancedScenePerview if I do

TSharedPtr<FAdvancedPreviewScene> PreviewScene; //<--- errror if i put it this way

TSharedPtr<class FAdvancedPreviewScene> PreviewScene; no error 

Even if i do the add class inside it gives me compile error coming from AdvancedPreviewScene module.

Hi! If you are using class method or template with class in template argument you should include header (.h) for that class for compiler to know how to do that. And if you just reference to class you can use predefenition for it (adding class keyword before its name), but of course can also include header (.h).