identifier "FArguments" is undefined When I trying to write my first plugin

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.

The console screenshot

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).

Hi there @duolanda,

Welcome to the Unreal Engine Forums! :tada: :partying_face:

This topic has been moved from International to Programming & Scripting: C++.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing!