DOREPLIFETIME->OutLifetimeProbs undeclared identifir

I think i got a bug in the Version 4.18.

If i want to replicate some values i got this error.

Try to recreate the bug.

  1. Create a new Project (ThirdPerson c++)
  2. Set up the …::GetLifetimeReplicatedProbs(TArray…) function
  3. Use DOREPLIFETIME(AActor, Value)

The Compiler give me this error:

1>D:\Unreal Engine 4\Work in Progress\---.cpp(133): error C2065: 'OutLifetimeProps': undeclared identifier
1>D:\Unreal Engine 4\Work in Progress\---.cpp(133): error C2228: left of '.AddUnique' must have class/struct/union
1>  D:\Unreal Engine 4\Work in Progress\--..cpp(133): note: type is 'unknown-type'

If i comment the DOREPLIFETIME out, then it compiles fine.
I have included Net/UnrealNetwork.h and tried a view others. Like Actor.h, Engine.h and so on. My Project is at the very beginning so i made a complete new Project with the 4.18. In Version 4.17 the same Setup works just fine.

Problem is solved. It seems that Visual Studio doesn’t search the Header files. After cleaning and deleting the source files and recreateing it, all works fine.

Ty a lot, i’ve got the same problem today and it helps a lot. ps dont forget to include Net/UnrealNetwork.h for people coming here later.

I just had this happen to me on 4.19

I just had this. The problem for me was that I had renamed the “OutLifetimeProps” parameter in the function definition:

void UClassName::GetLifetimeReplicatedProps( TArray& OutLifetimeProps ) const


This solved it for me as well. Weird that the name is important at all.