I’m getting the compile error:
Expected an include at the top of the header: ‘include “MessageHandling.generated.h”’
in my header file “MessageHandling.h”. The error seems to be caused by a macro in the file which includes the UCLASS macro:
#define DECLARE_MSG_TYPE_AND_DATA(messageName, messageDataClass) \
UCLASS() \
class messageName : public UObject, public messageDataClass { \
GENERATED_BODY() \
public: \
template<typename... Arguments> \
messageName(Arguments&&... args) : messageDataClass(std::forward<Arguments>(args)...) { } \
};
If I include MessageHandling.generated.h at the top of the file I instead get the error:
Cannot open include file: ‘MessageHandling.generated.h’: No such file or directory
So I’m not sure how to make the system happy. If I remove the UCLASS macro from this macro then the error goes away, but we need it, so, yeah… The generated.h files have been a constant source of headache for our project, so perhaps someone can direct me to some documentation about how the system works so we can finally get some work done.