Pointer to incomplete class

So I have a question first off I am not entirely new to c++ as I took one year of video game development and design in college but dropped out before we reached the UE4 part. Currently I am following a tutorial in the book mastering gaming for UE4 however I have been stuck on a part and in all honesty I think its just me overlooking something simple I keep getting the error Pointer to incomplete class is not allowed. Below is the code I have so far. Any help will be appreciated as Its been a while since I’ve done any c++ code I also apologize if I formatted this question wrong as this is my first post

// Fill out your copyright notice in the Description page of Project Settings.

#include "StealthCharacter.h"


void AStealthCharacter::SetupPlayerInputComponent(UInputComponent * PlayerInputComponent)
{
	// Binds the jump events //
	PlayerInputComponent-> BindAction ("Stealth", IE_Pressed, this, &AStealthCharacter::Stealth);
	PlayerInputComponent-> BindAction ("Stealth", IE_Released, this, &AStealthCharacter::UnStealth);

	Super::SetupPlayerInputComponent(PlayerInputComponent);
}

void AStealthCharacter::AddControllerPitchInput(float Val)
{
	const float fscale = bIsStealthed ? StealthPitchYawScale : 1.0f;
	
	Super::AddControllerPitchInput(Val*fscale);
}

void AStealthCharacter::AddControllerYawInput(float Val)
{
	const float fscale = bIsStealthed ? StealthPitchYawScale : 1.0f;
	
	Super::AddControllerYawInput(Val*fscale);
}

void AStealthCharacter::Stealth()
{
	bIsStealthed = true;
		Super::Crouch();

}

void AStealthCharacter::UnStealth()
{
	bIsStealthed = false;
		Super::UnCrouch();
}


So this is StealthCharacter.cpp the error am getting is in lines 9 and 10 under bind jump events comment




// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "MasteringCharacter.h"
#include "StealthCharacter.generated.h"

/**
 * 
 */
UCLASS()
class MASTERING_API AStealthCharacter : public AMasteringCharacter
{
	GENERATED_BODY()

	public: // modifer to turn out and pitch rate when we are in stealth//
		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
			float StealthPitchYawScale = 0.5f;
public: 
	virtual void SetupPlayerInputComponent(UInputComponent * PlayerInputComponent) override;

	virtual void AddControllerPitchInput(float Val) override;
	virtual void AddControllerYawInput(float Val) override;
	
	void Stealth();
	void UnStealth();

protected:
	bool bIsStealthed = false;
};

 this here is StealthCharacter.h

Thanks for the reply! It seems that fixed it! Thank you. Like I said before I am just coming back to it and one of the things we did not cover in the classes I took were pointers so I really do appreciate the help!

Typically that compiler error comes up when you’ve forgotten to include a necessary header in your class’s source (.cpp) file.

In your case, it looks like the compiler is upset about you trying to de-reference and “use” your PlayerInputComponent pointer, which is a UInputComponent object. It’s trying to tell you, “Hey, I don’t know what a UInputComponent is, so you’re not allowed to access its members — whatever they might be.”

So just try adding #include "Components/InputComponent.h" to the top of your class’s .cpp file and see if that doesn’t solve the error. This should teach your class what a UInputComponent is, and what its members are.

(Technically, I’m not sure that BindAction is a member function, because I think it’s a macro, possibly defined somewhere else. But give that include a try and write back if it doesn’t fix the problem.)