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

**URL:** <https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600>\
**Category:** C++\
**Tags:** error, Console, child-class, parent-class, unreal-engine, question, CPP\
**Created:** [July 20, 2016, 4:17pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600 "2016-07-20T16:17:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 4:17pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/1 "2016-07-20T16:17:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 20, 2016, 7:14pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/2 "2016-07-20T19:14:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 7:49pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/3 "2016-07-20T19:49:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 20, 2016, 7:56pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/4 "2016-07-20T19:56:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 8:10pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/5 "2016-07-20T20:10:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 20, 2016, 8:35pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/6 "2016-07-20T20:35:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 8:46pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/7 "2016-07-20T20:46:29Z")

</div>

![99333-moba_error_whyeven.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/8/008eb67d3f9a058243e56209201cbd5306979566.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 20, 2016, 9:00pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/8 "2016-07-20T21:00:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 9:15pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/9 "2016-07-20T21:15:48Z")

</div>

![99337-moba_vs_output.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/d/c6df2f2a8d5e4943ee33d6eab0b265abbfe02bd7.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 20, 2016, 9:31pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/10 "2016-07-20T21:31:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f43b8681](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f43b8681](https://forums.unrealengine.com/u/anonymous_user_f43b8681)\
**Post date:** [July 20, 2016, 9:42pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/11 "2016-07-20T21:42:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [July 26, 2016, 3:02pm UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/12 "2016-07-26T15:02:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ColdIronPoz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ColdIronPoz](https://forums.unrealengine.com/u/ColdIronPoz)\
**Post date:** [July 31, 2017, 2:28am UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/13 "2017-07-31T02:28:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Burnrate](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Burnrate](https://forums.unrealengine.com/u/Burnrate)\
**Post date:** [August 4, 2017, 4:34am UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/14 "2017-08-04T04:34:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Burnrate](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Burnrate](https://forums.unrealengine.com/u/Burnrate)\
**Post date:** [August 4, 2017, 4:46am UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/15 "2017-08-04T04:46:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_68405be61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_68405be61](https://forums.unrealengine.com/u/anonymous_user_68405be61)\
**Post date:** [July 25, 2018, 1:25am UTC](https://forums.unrealengine.com/t/child-class-wont-compile-because-base-class-has-errors-but-theyre-not-listed-in-the-console/364600/16 "2018-07-25T01:25:21Z")

</div>

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.
