Header file formatting causes GENERATED_BODY() macro to show error indicator


Everything is going well as far as the code is concerned and the game runs as expected, but every time I try to add comments or modify the top of OpenDoor.h, the GENERATED_BODY() macro shows red underlining and there’s a little red dot on the right side of the editor window beside the vertical slider. The code still compiles, and the game still runs the same, but it’s a little inconsistent showing an error and still compiling properly. I’m so used to separating my code with comment separators so I can see what’s where and what belongs with what, like #includes and #defines, and class definitions, etc.

The lines I insert come up with QuickAction entries on the left margin which have “Add Macro UCLASS to new C++ Hint file”, but having read the documentation on hint files (and still not understanding them thoroughly), I’m not certain this will help.

Is there anything that can be done to have comments, etc, and ‘fix’ the error indicator, or do I just leave the code as is?

I have found header changes to be a nuisance. This helps me:

  • Optimize your build for a small project: see this.
  • Rebuild from Unreal Editor (not Visual Studio) on header changes.

You should get the most down #include “OpenDoor.generated.h”

Privacy & Terms