Hey,
I’m trying to declare a delegate in a class that doesn’t inherit from a UE4 class but I’m getting compilation errors:
error C2143: syntax error : missing ';' before '<class-head>'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C3861: FLoginOK_DelegateWrapper': identifier not found
and here is a sample of my class:
#include "Engine.h"
#include "Delegate.h"
#include "DelegateBase.h"
#include "DelegateCombinations_Variadics.h"
#include "DelegateInstanceInterface_Variadics.h"
#include "IDelegateInstance.h"
#include "IntegerSequence.h"
#include "MulticastDelegateBase.h"
#include "Tuple.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLoginOK); // The error line.
class MYGAME_API AccountManager
{
private:
FLoginOK LoginSuccess;
};
As you can see I thought the macro definition was not being included so I included everything from the Delegates public module in the engine code to no avail. If I declare that delegate in a different header (with a class that inherits from a UE4 class) and include that header in this class (AccountManager) I am able to use that definition. The AccountManager class (the problem class) was created using the editor’s ‘New C++ class’ wizard.
Any ideas on why I would be getting an error?