Environment:Windows 11 21H2, UE 5.0.3, Visual Studio 2022(also tried UE 4.27.2 and Visual Studio 2019, but nothing changed)
I want to develop a simple UE plugin, and before I start to write the main code, I met a strange Error. I import header files, and they really work,but the editor tell me “identifier “FArguments” is undefined”. When I complie in UE Editor, it tells me:
error c4430: missing type specifier – int assumed Note: C++ does not support default-int
error c2143: syntax error : missing '; ’ before ‘&’
I am so confused,since I check the code many times, and even reinstalled UE and Visual Studio.
A little late to the party, but I had the same problem. You need to use the C++ MACROS for Slate Arguments in your class. So your class should look like this:
class SFeiToolboxMain : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SFeiToolboxMain) {}
SLATE_END_ARGS();
void Construct(const FArguments& InArgs);
FReply TestClick();
};
Additional:
If you are wondering how to implement those Slate Arguments, the SImage class is a good example (found at Engine\Source\Runtime\SlateCore\Public\Widgets\Images\SImage.h).