GENERATED_BODY error

When I build my project, the editor gives me an error.

USTRUCT()
struct STATEMACHINE_API FStateMachineResult
{
	GENERATED_BODY()

	UPROPERTY()
	EStateMachineCompoletionType CompletionType;

	UPROPERTY()
	USM_STate* FinalState;

	UPROPERTY()
	int32 DateIndex;
};

Undefined identifier “MissionSystem_Plugins_StateMachine_Source_StateMachine_Classes_SM_State_h_24_GENERATED_BODY”

2>EXEC : error : UnrealHeaderTool failed for target ‘MissionSystemEditor’ (platform: Win64, module info: D:\Library\Document\Unreal Projects\MissionSystem\Intermediate\Build\Win64\MissionSystemEditor\Development\MissionSystemEditor.uhtmanifest, exit code: OtherCompilationError (5)).

where did u put your header file ?

also do a try by removing STATEMACHINE_API .

130879-header.jpg

if I remove STATEMACHINE_API, how to use this struct in the editor?

I tried. but it still doesn’t work.

I tried it, and get these error.
cant open source “SM_State.generated.h”

undefined GENERATED_USTRUCT_BODY()

An irrelevant question
I created a plugin, but i cant find the PCH.h file.
My unreal engine version is 4.15

my mistake.
i should have noticed that it is an struct.

change GENERATED_BODY() to GENERATED_USTRUCT_BODY().

USTRUCT()
struct  STATEMACHINE_API  FStateMachineResult
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY()
	EStateMachineCompletionType CompletionType;

	UPROPERTY()
	USM_State* FinalState;

	UPROPERTY()
	int32 DataIndex;
};

delete this Intermediate folder:
D:\Library\Document\Unreal Projects\MissionSystem\Intermediate\

also search for any other Intermediate folders and delete them too. specially inside plugins
then regenerate the project and rebuild from visual studio.

cant open source
“SM_State.generated.h”

regenerate the project and then build the project. that error will be gone.

i tried to regenerate the project, but i cant build it.