Class member cannot be redeclared

Hi,

I see this every once in a while:

void MyServerSetMsg_Implementation(const FString& MSG);
       ^
error: class member cannot be redeclared

and then:

        GENERATED_UCLASS_BODY()
note: previous declaration is here ^

Runtime/CoreUObject/Public/UObject/ObjectBase.h:596:36: note: expanded from macro 'GENERATED_UCLASS_BODY'
#define GENERATED_UCLASS_BODY(...) GENERATED_BODY_LEGACY()
                                   ^
Runtime/CoreUObject/Public/UObject/ObjectBase.h:592:36: note: expanded from macro 'GENERATED_BODY_LEGACY'
#define GENERATED_BODY_LEGACY(...) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_GENERATED_BODY_LEGACY)
                                   ^
Runtime/CoreUObject/Public/UObject/ObjectBase.h:590:37: note: expanded from macro 'BODY_MACRO_COMBINE'
#define BODY_MACRO_COMBINE(A,B,C,D) BODY_MACRO_COMBINE_INNER(A,B,C,D)
                                    ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
<scratch space>:22:1: note: expanded from here

I still haven’t found the root cause, sometimes removing the entire “projectFolder”/Intermediate folder is the only way to clear this error.

I know the function is NOT declared twice but UE4 seems to mistake it for something that’s already declared in the MACRO… although, eventually after many recompilations, it works. I’m not using an IDE, but I remember with Codelite and Kdevelop I had the same issue pop out once in a while when I made structural changes to my .h files.

Any idea why ? Is there a cache of the precompiled header files which should be cleaned… somewhere?
(also tried removing generated files, which did more harm than good)

Thanks for any help you can provide

I just noticed something weird which may be related.

Seems this error is triggered when I use:
UFUNCTION(reliable, NetMulticast)

…on top of the MyServerSetMsg_Implementation function. If I remove the replication macro, it continues without errors…?