User should not define functions with such specifiers, they are autogenerated by UHT. Definition should go into Func_Implementation.
Using UFUNCTION(Server, Reliable, WithValidation) with an RPC function results in a failed build in Visual Studio.
The same test in Main yields a different set of error messages.
UFUNCTION(Server, Reliable, WithValidation) void ServerTestMessage();
void /*ClassName*/::ServerTestMessage() { if (Role < ROLE_Authority) { if (GEngine) { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Greetings from the ServerTestMessage function.")); } ServerTestMessage(); } } bool /*ClassName*/::ServerTestMessage_Validate() { return true; } void /*ClassName*/::ServerTestMessage_Implementation() { ServerTestMessage(); }
RESULT:
The build fails with the following errors:
1>TestMulticast2.generated.cpp.obj : error LNK2005: "public: void __cdecl ATestMulticast2Character::ServerTestMessage(void)" (?ServerTestMessage@ATestMulticast2Character@@QEAAXXZ) already defined in TestMulticast2Character.cpp.obj
1>C:\Users\Tim.Lincoln\Documents\Unreal Projects\TestMulticast2\Binaries\Win64\UE4Editor-TestMulticast2.dll : fatal error LNK1169: one or more multiply defined symbols found
EXPECTED:
The build completes successfully.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Networking |
---|---|
Affects Versions | 4.7.3 |
Target Fix | 4.8 |
Created | Apr 1, 2015 |
---|---|
Resolved | Apr 7, 2015 |
Updated | Apr 27, 2018 |