GENERATED_BODY macro causes error "this declaration has no storage class or type specifier"

The fix for me was actually to* add *an extra line after GENERATED_BODY(). Thus, there are two line skips before the next contents (“public:”). Here is the working code:


UCLASS()
class UOculusIAPBPLibrary : public UBlueprintFunctionLibrary
{    
    GENERATED_BODY()
     //Line skip 1
     //Line skip 2
public:

Coincidentally, it seems to need an extra line for each new UFUNCTION added, which is weird as there were already multiple…I’m thinking maybe it doesn’t like comments on the lines before each UFUNCTION.

Apparently, it’s also not good to have multiple UClass() calls in the same constructor file. If there are multiple classes, call them individually without adding the “UCLASS()”, nor “GENERATED_BODY()”

5 Likes