Why do I get a LNK error for GetLifetimeReplicatedProps() in a class that does not use that function?

I had this problem too,in my case it happens when an UPROPERTY has the “REPLICATED” flag on it.

How To Fix It:

In Your .h :

UPROPERTY(replicated)
AYourActorClass* ClassOwner;

In Your .cpp :

void AYourClassName::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
    DOREPLIFETIME(AYourActorClass, ClassOwner);
}

Hope this solves your problem. I Kinda guess this function is needed for replication.