Replication Code gone wrong. Help?

Here are my classes:

SecretPlayerState.h

#pragma once
#include "GameFramework/PlayerState.h"
#include "SecretPlayerState.generated.h"
#include "Core.h"

UCLASS()
class SECRET_API ASecretPlayerState : public APlayerState{
	GENERATED_BODY()
public:
	ASecretPlayerState(const FObjectInitializer& ObjectInitializer);
	UPROPERTY(BlueprintReadWrite, Category = "Attribute", EditAnywhere, Replicated)
	int32 health;
};

SecretPlayerState.cpp

    #include "Secret.h"
    #include "SecretPlayerState.h"
    #include "UnrealNetwork.h"             
     ASecretPlayerState::ASecretPlayerState(const FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer){
         bReplicates = true;
         health = 100;
    }
                    
   void ASecretPlayerState::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
            DOREPLIFETIME( ASecretPlayerState, health);
}

This is the error i get:

    :\Program Files\Epic Games\4.7\Engine\Source\Runtime\Engine\Public\Net\UnrealNetwork.h(78): error C2653: 'FLogCategoryLogNet' : is not a class or namespace name
    1>C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Engine\Public\Net\UnrealNetwork.h(78): error C2065: 'CompileTimeVerbosity' : undeclared identifier
    1>C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\Engine\Public\Net\UnrealNetwork.h(78): error C2065: 'LogNet' : undeclared identifier
 There is more to this error but its huge

I tried using that tutorial, and it kind of fixed the issue, but it gave me more errors now. I edited my original post

When you declare a replicated property, you have to implement GetLifetimeReplicatedProps(). See this replication intro tutorial.

UnrealNetwork.h is relying on some logging methods that it should have included or forward-declared. I believe you can fix the error by adding #include "Engine.h" before the UnrealNetwork.h include.

It worked Thanks! Now, how do i connect this playerstate to a character?

I have a custom gamemode that chooses thirdpersonplayer as the default pawn, and a secretplayerstate as the playerstate. But it says that thirdperson is not part of secretplayerstate

What’s your code code and what’s the exact error message?