Add C++ files from Visual Studio

I am trying to add a new C++ header to my game, but when I generate Visual Studio files it doesn’t generate the AnimNode_weapon.generated.h file.

The code of the file is:

//AnimNode_weapon.h
   #pragma once
    
    #include "Runtime\Engine\Classes\Animation\AnimNodeBase.h"
    #include "AnimNode_weapon.generated.h"
    
    USTRUCT()
    struct FAnimNode_weapon : public FAnimNode_Base {
    	GENERATED_BODY()
    
    	FAnimNode_weapon();
    };

What I have trying:

1 Put this file in the source direcotry.

2 Delete the bin and Intermediate folders.

3 Right click on the project and Generate Visual Studio project files.

create your c++ files from Unreal Editor using “Add a new C++ class”, it’s the best way to do it and you won’t have errors :wink:

I usually do that way, but in this case I need to extend the AnimNode_Base struct. I can´t extend a struct from the editor. I’ll try to create a class in the editor and substitute the code.

Ok, I fixed it by typing game name_API behind struct keyword as in the classes files. Now the .generated.h is created. Thanks for answering.

Nice to see that you find a solution !