DECLARE_DYNAMIC_MULTICAST_DELEGATE error: no storage class or type specifier

Hi, im using 4.20 and im having trouble creating blueprint event.
Specifically when I’m trying declare a delegate

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnOpenRequest);

I get an error “this declaration has no storage class or type specifier”.

I tried to compile it first in the unreal editor, build the project in different configurations (debug, dev editor etc…), reopen VS and UE, include Delegate.h.

Later on when I declare the UPROPERTY:

UPROPERTY(BlueprintAssignable)
FOnOpenRequest OnOpenRequest;

I get an error of “FOnOpenRequest is undefined”.

I have no idea if I’m doing something wrong or its a bug, I’m new to UE.
Thanks in advance.

Edit: Both of the errors I noticed are IntelliSense errors because the program compiles, but they are leading to compilation error when in the .cpp file I try to

OnOpenRequest.BroadCast();

which says: error C2039: ‘BroadCast’: is not a member of ‘FOnOpenRequest’.

Solution: The problem was uppercase ‘C’ instead of lower case in the Broadcase();. The problematic intellisense won’t do auto completion.

Are you including declaration to the file where you are trying to create a variable?
Have you tried regenerate projects file? (right click on .uproject file)

#include "Delegates/Delegate.h"

MyDelegate.h

#include "CoreMinimal.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnOpenRequest);

AnotherFile.h

#include "MyDelegate.h"

UPROPERTY(BlueprintAssignable)
FOnOpenRequest OnOpenRequest;

Afaik you don’t need to add a semicolon after the declare delegate’s closing paranthese. Not sure if that’s the problem

Also is the error on compilation or just the vs coz vs often flags UHT stuff as error but compiler runs fine

The first error: “this declaration has no storage class or type specifier”, is intellisense only. It gets compiled both in the VS and UE.
But the second one is compilation “FOnOpenRequest is undefined”.

Yea, I did try that to no avail.

Yea, i have a feeling its maybe something with the includes but I did include “Delegates/Delegate.h” and also #include “CoreMinimal.h”.
Both the delegate declaration and the UPROPERTY are in the same .h file in my project.

Actually you do need it or you will get “Missing ‘;’ before UCLASS” (atleast in my code cuz thats what after it)

Yes, you are right. both errors were intellisense, I had a problem with spelling BroadCast() instead of Broadcast, didn’t notice because no auto completion of intellisense.

For anybody having this problem:

#include "Delegates/Delegate.h"

Then switch the solution configuration to anything (e.g. Development Editor to Development Client), then switch it back to the original, and the Intellisense should work again.

1 Like

not working

It’s because there is not <Your Signature>.BroadCast() . There is no capital ‘C’. It should be <Your Signature>.Broadcast().

I was honestly just trying to make a completly standard Event Dispatcher.
Yet this is the method that pops up as the suggested one. A dynamic multicast is not required for most cases. Read more in this discussion

My solution: Drop the DYNAMIC and it works (including delegate.h was not nessesary).

DECLARE_MULTICAST_DELEGATE(FMyName)
2 Likes

This is what worked for me

I met the same error, and change DECLARE_MULTICAST_DELEGATE to DECLARE_DYNAMIC_MULTICAST_DELEGATE. It works, I don’t know why.

Trying to compile without semi-colon and then with it again fixed intellisense for me.

1 Like