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"

Child class won't compile because base class has errors, but they're not listed in the console

A child class of mine has errors due to new functionality added to a base class, however the console will not tell me what the errors are, only that they exist. Any way to get the errors?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 20 '16 at 04:17 PM in C++ Programming

avatar image

Warlahamaran
16 3 4 7

avatar image Doug E ♦♦ STAFF Jul 20 '16 at 07:14 PM

Hey Tommy-

Can you explain the functionality that was added to the parent class and provide the full error you're getting from the child class? If you comment out the new functionality from the parent, does the child class compile again? Are you able to compile if you move the functionality from the parent to the child?

avatar image Warlahamaran Jul 20 '16 at 07:49 PM

Hi. The functonality added was two variables, CurrentHealth and MaxHealth, a take damage functiion and a GetLifetimeReplicatedProps function.

Commenting out the code yields the same problem. Moving the functionality to the child is not feasible.

avatar image Doug E ♦♦ STAFF Jul 20 '16 at 07:56 PM

I presume the problem is that the code isn't compiling, is that correct? If commenting out the newly added functionality still gives the same error, can you provide the output log from VS for additional information.

avatar image Warlahamaran Jul 20 '16 at 08:10 PM

There is nothing in the output in VS, the main thing i want is for unreal to tell me what the problem is, but it is extremely ambiguous, only saying that there's an error in the parent class

avatar image Doug E ♦♦ STAFF Jul 20 '16 at 08:35 PM

So the code compile successfully then? To help me understand what's happening, can you post a screenshot of the error message you're getting?

avatar image Warlahamaran Jul 20 '16 at 08:46 PM

alt text

avatar image Doug E ♦♦ STAFF Jul 20 '16 at 09:00 PM

Where the error shows "OtherCompilationError(5)" - This line means that the error that occurred isn't something that has an error code related to it. If you compile the code in Visual Studio, you can check the Output log for more information in the majority of situations that involve this message. Please try compiling in Visual Studio and provide a screenshot of the Output log.

avatar image Warlahamaran Jul 20 '16 at 09:15 PM

alt text

moba_vs_output.png (209.6 kB)
avatar image Doug E ♦♦ STAFF Jul 20 '16 at 09:31 PM

Now I understand your confusion. I've not seen Visual Studio return an error message like that before. It appears that it's attempting to compile the child class before the parent which is why it's not stating what the parent's errors are. Can you try to move the header and source files for BasePlayerUnit out of the project (copy them to another folder and then delete from the project). Once you've done this you'll need to right click on the .uproject file and select Generate Visual Studio project files. This will update the .sln and remove the BasePlayerUnit class from the solution. Then when you build the project again, it should report what the errors are in BaseUnit class.

avatar image Warlahamaran Jul 20 '16 at 09:42 PM

Ah, thank you. I'll try this once I'm home as an emergency came up.

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

2 answers: sort voted first

This may be an indication that you have a circular reference in your header includes. Check that out and see.

more ▼

answered Aug 04 '17 at 04:46 AM

avatar image

Burnrate
279 14 27 91

avatar image Vrezhg Jul 25 '18 at 01:25 AM

This was my issue, had two different characters have an attached actor component, when I included one of the characters headers to be able to do a cast for the owner of the actor component to do different functionalities depending on what kind of character it was I got a circular dependency and it started saying that my characters base class had a problem compiling.

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

Hey Tommy-

We've not heard from you in a few days. Were you able to try the suggestion of removing the child class from the project temporarily and build again to get the errors from the parent? Let me know if the reported error message is still vague and we can investigate further.

Cheers

Doug Wilson

more ▼

answered Jul 26 '16 at 03:02 PM

avatar image ColdIronPoz Jul 31 '17 at 02:28 AM

I've just started to get this same kind of result. I'll try unraveling the child from the parent.

avatar image Burnrate Aug 04 '17 at 04:34 AM

Any results from the investigation? I've tried stripping all the classes of all functionality and still get the same results.

Edit: Was a dumb circular reference in the header includes.

(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