x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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    

alt text

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: https://answers.unrealengine.com/questions/299013/uclass-error.html and https://answers.unrealengine.com/questions/671630/c-header-file-problem-with-416.html

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: https://github.com/sudhaMR/IntersectionTest/tree/master/Source/IntersectionTests

Product Version: UE 4.18
Tags:
include-error.png (114.5 kB)
more ▼

asked Apr 30 '19 at 08:07 AM in C++ Programming

avatar image

sudhamr
7 1 1 3

avatar image HarryHighDef Apr 30 '19 at 08:27 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Apr 30 '19 at 08:28 AM

avatar image

Lardo Deepdelver
951 6 4 6

avatar image sudhamr May 01 '19 at 12:25 AM

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

avatar image Lardo Deepdelver May 01 '19 at 07:21 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question