Unrecognized type 'TSubobjectPtr' error when trying to use custom PawnMovementComponent

here is the pawn class :

#pragma once

#include "NWGFPDefaultMovement.h"
#include "GameFramework/Pawn.h"
#include "NWGFPPawn.generated.h"

UCLASS()
class ANWGFPPawn : public APawn
{
	GENERATED_UCLASS_BODY()

	
	UPROPERTY(Category = NWGFP, VisibleAnywhere, BlueprintReadOnly)
	TSubobjectPtr<class USkeletalMeshComponent> HandMeshComponent;

	UPROPERTY()
	TSubobjectPtr<class UArrowComponent> ArrowComponent;

	UPROPERTY(Category = NWGFP, VisibleAnywhere, BlueprintReadOnly)
	TSubobjectPtr<class UCapsuleComponent> CapsuleComponent;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	TSubobjectPtr<class UNWGFPDefaultMovement> MovementComponent;


	static FName MeshComponentName;

	static FName MovementComponentName;

	static FName CapsuleComponentName;


	//Begin Pawn Interface
	virtual class UPawnMovementComponent* GetMovementComponent() const OVERRIDE
	{ 
		return Cast<UPawnMovementComponent>(MovementComponent);
	}
	//End Pawn Interface
};

and here is the error :

In NWGFPPawn: Unrecognized type 'TSubobjectPtr'

PS. I tried to use UNWGFPDefaultMovement without TSubobjectPtr and find out that the problem is actually unrecognition of UNWGFPDefaultMovement . but why is that? here is a part of NWGFPDefaultMovement.h:

#pragma once
#include "GameFramework/PawnMovementComponent.h"

UCLASS()
class UNWGFPDefaultMovement : public UPawnMovementComponent
{