Hi,
i introduced an ENUM in my project in a separate .h - file, called “Eventnames.h”. I added it in VS via the “Add new item” window as normally.
#pragma once
UENUM(BlueprintType)
enum class EEventNames : uint8
{
FROM_UI_SEND_TEXTFIELD_VALUE,
FROM_UI_SEND_VECTOR_VALUE,
FROM_UI_SEND_SLIDER_VALUE,
FROM_UI_SEND_TOGGLE_VALUE
};
This worked. In the class which uses the Enum it was imported with #include “Ui/EventNames.h”.
As the project grows, so did the needed Enums and i introduced more Enums and more files.
At some point the Compiler complains about that it does not now BlueprintType and stuff.
\Public\Ui/EventNames.h(3): error C2065: 'BlueprintType': undeclared identifier
\Public\Ui/EventNames.h(3): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\Public\Ui/EventNames.h(4): error C2059: syntax error: 'enum [tag]'
\Public\Ui/EventNames.h(4): error C2059: syntax error: 'function-style cast'
\Public\Ui/EventNames.h(5): error C2143: syntax error: missing ';' before '{'
\Public\Ui/EventNames.h(5): error C2447: '{': missing function header (old-style formal list?)
I could not figured out whats the problem, because if i copy-paste the ENUM(s) from the files and pasted it in the Class-Header it instantly worked again.
Are there some recommendations when using ENUMs in separate files ?
Thank you in advance.
Seim