Function already defined in Function.gen.cpp.obj

Hey all,

When I try to build my project im getting these errors:

The function in question
Header

UFUNCTION(Reliable, BlueprintCallable, NetMulticast)
void GoCriticalClientsCPP();

Cpp file

#include "CPP_GroundTeamClass.h"
#include "Net/Unrealnetwork.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/GameplayStatics.h"
#include <iostream>

void ACPP_GroundTeamClass::GoCriticalClientsCPP()
{...}

I think it has something to do with replication becuase if i remove ‘reliable’ & ‘netmulticast’ from UFUNCTION it builds fine, but I’m honestly not sure.

Any help would be appreciated.

(I haven’t posted before so if anymore information is needed just let me know)

For a NetMulticast function it is declared like so:

void GoCriticalClientsCPP();

but your implementation needs to have “_Implementation” added to the name, so your function should be called (in the cpp file)

void ACPP_GroundTeamClass::GoCriticalClientsCPP_Implementation()
{...}

Unreal generates the code for GoCriticalClientsCPP() which eventually calls your GoCriticalClientsCPP_Implementation() - the code for that generated function is what is in the .gen.cpp.obj file

1 Like

Forgot to get back to you, but it worked perfectly. Much appreciated

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.