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?
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?
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.
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.
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
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?
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.
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.
Ah, thank you. I’ll try this once I’m home as an emergency came up.
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
I’ve just started to get this same kind of result. I’ll try unraveling the child from the parent.
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.
This may be an indication that you have a circular reference in your header includes. Check that out and see.
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.