DECLARE_DYNAMIC_DELEGATE_Retval doesn't compile

Hey all, I’m trying to create a dynamic delegate with return value, but it won’t compile. It’s giving me the old “missing ;” error that I’m sure we’ve all seen a thousand times.

DECLARE_DELEGATE_RetVal_OneParam(FReturnStruct, FExampleDelegate, FExampleParam) works, but

DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(FReturnStruct, FExampleDelegate, FExampleParam, ExampleParam) does not.

My headers are:

#include <UObject/ObjectMacros.h>
#include <UObject/ScriptMacros.h>
#include <UObject/ScriptDelegates.h>
#include "nXinclude/nXhumanEventAggregator.h"
#include "nXinclude/FlowControl.h"
#include <memory>
#include "FFunctionStructs.h"
#include "FStateStructs.h"
#include "nXhuman.generated.h"

I have several dynamic multicast delegates, with varying parameters, which are all compiling in the same header file. I’d like to be able to expose this to blueprints, if possible, since the callback I am trying to create will be eventually used by an engineer who is very familiar with blueprints, but not C++.

Thanks to anyone who can help.

Hi jamestillerunc,

Sorry for the delayed response to your post. Are you still having trouble with this issue? I tried to recreate this issue in 4.15.2, but was unable to do so. I used the following declaration: DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(FMyStruct, FNewDelegate, int32, TheParam);

Where does the compiler show that the error is occurring?

Hi jamestillerunc,

We have not heard back from you for a while. Do you still need help with this issue? I will be marking this post as resolved for internal tracking purposes, but please feel free to add a comment and re-open this post if you need any additional assistance.