Generate method "~.generated.h"

Please help you.

UFUNCTION macro is write on source code.
It’s source code compile error.
No such “filename.generated.h”.
Could you teach me generate method a “filename.generated.h”.

Thank you.

Right click on your project file (for example MyGame.uproject) and click on Generate Visual Studio Project Files after. Project files will be generated at Intermediate\Build… folder.

In your header file (filename.h) must be created classes or structs marked with macro UCLASS() or USTRUCT(). And also with same as header file name source must be exist (filename.cpp).

If files can not be generated, there are errors or something else :slight_smile:

Thank you for your response.

Now making plugin of the Unreal Project.
This is new plugin of the blank plugin.
UCLASS(), UFUNCTION() and GENERATED_BODY() was added to the “MyPlugin.h” source.
I tried build to solution configuration is DebugGame Editor project.
I did build then UnrealHeaderTool execute.
But not make “MyPlugin.generated.h”.
The first place “Intermediate” folder is not generate in the “MyProject\Plugins\MyPlugin” folder.
UCLASS(), UFUNCTION() and GENERATE_UCLASS_BODY() is there red underline.
Error of UCLASS() is “This declaration has no storage or type specifier”.

Does it have to be set in the other?

  1. You must place #include “MyPlugin.generated.h” after all other includes. This is condition of UnrealHeaderTool.
  2. Macro GENERATED_BODY() is not expects a semicolon.
  3. #pragma once must be placed at top of header file
  4. I’m not worked with plugins, but I’m sure, just look at ready examples and you will create your own plugin easily. For example: …\Epic Games\4.10\Engine\Plugins\Blendables\LightPropagationVolume\Source\LightPropagationVolumeEditor

P.S. Try for first realize your goals without using plugins. Just create C++ project and learn how UE4 complier works.

OK, Try to learn.
Try from now.
Also thank you .