Single empty c++ line influences compile result

Hi,

It’s hard to tell from the information you have provided, but at a guess, UnrealHeaderTool hasn’t rerun for some reason. Perhaps if you added and removed the line while UnrealHeaderTool was running, it would get confused with the timestamps of the generated code and not rerun.

But the reason for the errors is that the .generated.h header contains line references to the reflection macros in the .h file. GENERATED_BODY(), for example, can be specified multiple times for different classes/structs in the same header, but the macro needs to expand to the right struct-specific code in each case, and this disambiguation is done by the line number of the macro. So if the .generated.h doesn’t match the .h, it will result in these kind of compile errors.

Hope this is clear,

Steve