I want to bump an issue that has been in the engine for years** but that has become especially problematic since the IWYU system got shipped. Basically, you can only add as many #includes as you have blank lines above #include “filename.generated.h”. If you mess with the lines above the UClass statement in any other way, you get an error saying that Generated_Body() ‘has no storage class or class specifier’.
Now, there is a workaround. If you compile in the editor, then refresh the VS project and then reload/reopen the project, the error goes away. Still, it’s annoying to have to jump through this hoop every time you want to include something (not to mention, it’s frustrating and confusing to people who are new to the engine). I believe this issue got marked as solved, but the problem lingers.
**Since 4.8 according to this thread: Adding additional includes breaks my class - Programming & Scripting - Epic Developer Community Forums