Syntax error declaring dynamic multicast delegate

On declaring dynamic multicast delegate with code below

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FNaItemListSlotEvent, int, Position);

I got this compiling error:

error C2143: syntax error: missing ';' before '<class-head>'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C3861: 'FNaItemListSlotEvent_DelegateWrapper': identifier not found

How can I declare this delegate correctly?

Thank you!

1 Like

You are likely missing the #include that the delegate is declared in.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam seems to be defined in file included in CoreMinimal.h…

I tried to remove all references of the delegate and simply declare an unused one, but the error still exist.
However, if the delegate is declared non-dynamic, i.e.
DECLARE_MULTICAST_DELEGATE_OneParam(FNaItemListSlotEvent, int);
It compiles.