Errors on Generated_Body() when including header file

I have been trying to include a C++ class header file into another class. I am using Visual Studio 2017. This has happened multiple times in the past when I include the header file (above generated.h) but the UCLASS() line number changes and I get an error on the GENERATED BODY() line that is:

Error (active)	E0077	this declaration has no storage class or type specifier

I had only one more header file to include, so I managed to squeeze it in between one of the lines such that the line number of UCLASS() or GENERATED BODY() doesn’t change. But now, the GENERATED BODY() line gives an error:

Error (active)	E0165	too few arguments in function call	

I had it working with just PlaneClass.h by making sure the UCLASS doesn’t change. But, I can’t do it anymore with the AABB.h class. It is sort of crazy this could happen.
I tried out the answers here: UCLASS() error - Pipeline & Plugins - Epic Developer Community Forums
and
C++ header file problem with 4.16 - Programming & Scripting - Epic Developer Community Forums

But, as opposed to the forums above saying it is an intellisense error, mine indeed is a compile error.

Here is the source code for the classes: IntersectionTest/Source/IntersectionTests at master · sudhaMR/IntersectionTest · GitHub

I’m using 4.22.1, downloaded your project
tried to compile got this error in output tab:

2>/Source/IntersectionTests/AABBClass.h(39) : LogCompile: Error: BlueprintReadWrite should not be used on private members
2>/Source/IntersectionTests/AABBClass.h(42) : LogCompile: Error: BlueprintReadWrite should not be used on private members
2>/Source/IntersectionTests/AABBClass.h(45) : LogCompile: Error: BlueprintReadWrite should not be used on private members
2>/Source/IntersectionTests/AABBClass.h(48) : LogCompile: Error: BlueprintReadWrite should not be used on private members

you can not use BlueprintReadWrite on private members, you have two options to fix that

  1. Make them protected

  2. Add meta = (AllowPrivateAccess = “true”) to the UPROPERTY values

    protected:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite)
    	FVector boxOrigin;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite)
    	FVector boxExtent;
    
    private:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
    	FVector boxMin;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
    	FVector boxMax;
    

after doing that it compiled for me

Have you read through your output when you compile?
Have you tried deleting the generated.h file?

This worked! I still get the same two errors from intellisense on the GeneratedBody() line but it seems to compile. Thank you!

It’s always a good idea to have a look into the Output Window in Visual Studio, normally the errors are explained better there.

Could you also pls accepted the answer, so that it gets closed.