Code without syntax errors, but unable to compile successfully (possible bug)

I’m currently using the Early Access UE5 and have come across something I’ve not seen before, therefore asking the forum community to see if there is something I’m missing or there is a bug in the engine?

Inside the classes everything appears to be above board, no syntax errors, or function variables, that are out of place, however; in the error list pane, I’m seeing errors at build time. The errors also appears when I try to go through the UE5 Logo (which is not [currently] appearing in my Unreal Project folder) I’ve attached ‘Screen shots’ for advice to determine if there is something syntactically from any of the classes, source code or whether to do a Submission Debug , to Epic Games?




As I’ve mentioned I’ve checked and rechecked the source code, line by line, however when it comes to building/Re-building and compiling from the Unreal Project folder (UE Icon missing) it seem to just crash the Early Access version. Can anyone offer any recommendations on how to solve this C++ issue?

Many thanks for reading.
Brandon

Those are linker errors, which happen after compilation, and are not syntax errors.

I know the error. When you have replicated properties in an Actor, you need to add this function to the Actor.

void AMyActor::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    // Replicate to everyone
    DOREPLIFETIME(AMyActor, VariableName);
    DOREPLIFETIME(AMyActor, AnotherVariableName);
}

Add it to the source file. You don’t need to add its prototype the the header file. You’ll need a DOREPLIFETIME for every variable marked as Replicated.

The error is from the linker getting mad at you because it can’t find that function. :face_with_monocle:

Hope this helps!

1 Like

Oh, and also you need to put

#include "Net/UnrealNetwork.h"

in your CPP file

1 Like

Many thanks for that message.

Thank you @NachoMonkey2, I’ve made the changes you had so kindly offered and your guidance has indeed paid dividends. Many thanks for your assistance today. Forever in your debt, dear developer. Forever in your debt. Brandon :ok_hand::ok_hand::ok_hand:

You’re welcome!

1 Like