Over the past year or so I have created and abandoned dozens of projects. Each time I setup a new C++ project it is a NIGHTMARE. That is why I abandon so many of them. Just getting the engine to configured at the start of a project exhausts me.
Anyways, the problem I am having now (for the nth time) is that I cannot add new C++ classes to my project because unreal is not generating the .generated.h header files. I think the fact that my classes do not show up in the editor is a side effect of this, but I’m not sure.
I have tried everything I can think of. Deleted the binaries. Deleted all the file structure and started over, included recreating the classes I had made. compiling the code in and out of the editor, a dozen times.
I have spent so many hours (now and in the past) just trying to get the engine to compile the most basic C++ classes that I am nearly to the point of asking Epic to pay me for my mental health.
Does anyone know what I can do to do my classes to generate .h files?
The .generated.h files are created by UHT when you build the project, they are not created manually or when you create a new CPP/H file.
They are also only created for headers which actually have reflected types in them, such as UCLASS, USTRUCT or UENUM - and should therefore only be included in headers which have items like that in them. Intellisense doesn’t understand any of this so will constantly spew out bogus errors about missing files, but they can be ignored. This is also why Epic recommends disabling the VS ‘Error List’ entirely - since it’s usually just full of things you can ignore.
Deleting binaries and regenerating solution files will not solve anything here as there is nothing to solve. If you have a reflected type declared in a header, you add the .generated.h include to the top. That’s all you need to do.
Are you creating new class within the Unreal Editor as this creates everything you need? I’ve never had any issues with .generated.h not being created correctly.
Yes I learned a while ago I have to use the editor to create my .h/,cpp files.
I started with the top down template. The first thing I did was create a player controller and a character in a folder called player. They worked fine.
From that point on all my files have been “none” parent class. These files do not generate .generated files nor do they show up in the editor.