Problems in .cpp with GetLifetimeReplicatedProps definition

I am having a problem in the definition in the .cpp in UE5.2.

If I put this in the .h

virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

And If I put this in the .cpp I get these errors.

From Rider:

void AOurActor::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps) const { // ERROR Qualifier 'const' is only allowed on non-static member functions
     Super::GetLifetimeReplicatedProps(OutLifetimeProps); // Cannot resolve symbol 'OutLifetimeProps' 
     DOREPLIFETIME(AOurActor,ReplicatedVariable); // Cannot resolve symbol 'OutLifetimeProps'
   }

Now, if the signature and the definition are in the .h, it works correctly.
I don’t mind leaving it in the .h even though it’s bad practice.
The question is

What happens to the .cpp definition?

I have a question for you.
If it works correctly for me in the .h, what makes you think I didn’t include that line?
What makes you think you can run that code in the .h without that line?

Sorry, I was only trying to help. // Cannot resolve symbol 'OutLifetimeProps' makes me think that it’s possible that the .cpp file is unaware of the definition of FLifetimeProperty.

Don’t worry.

Any solution to the .cpp problem?