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"

2 errors causing each other

I seem to have a dilemma regarding two errors. My first error is as follows: CombatStarship.h(15): error : 'CombatStarship' can't be compiled: Parent class 'Starship' has errors

The only error in Starship is that it cannot open the generated header. However, because I have the above error, I believe I cannot generate my headers. What do I do?

I cannot recompile the DLL and I cannot get into the editor.

Product Version: UE 4.19
Tags:
more ▼

asked Sep 01 '18 at 12:40 PM in Using UE4

avatar image

AngryBeanspr0ut
24 1 1 6

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

I found the solution a while back but didnt post my results. I pulled an old version of my project from git and replaced the code. There were several circular dependencies, and even forward declarations wouldn't let it compile. I just restructured my code and it worked.

more ▼

answered Sep 10 '18 at 02:17 PM

avatar image

AngryBeanspr0ut
24 1 1 6

(comments are locked)
10|2000 characters needed characters left

well something is missing somewhere, Even tho you can't launch the editor you should be able to open the Visual studio solution. once in there the build should tell you more than what you actually see.

more ▼

answered Sep 01 '18 at 12:45 PM

avatar image

TheDreamCatcher
253 2 4 5

avatar image AngryBeanspr0ut Sep 01 '18 at 03:24 PM

I don't think I understand. The error I gave was from my build. Here is the full log if you want.

log.txt (2.0 kB)
avatar image TheDreamCatcher Sep 01 '18 at 03:42 PM

check your Build.cs. and Target.cs to verify the names there. UBT seems to be trying to target a project that does not exist. A variation with some names will cause this kind of errors.

avatar image AngryBeanspr0ut Sep 01 '18 at 03:47 PM

the files have the same name, and ive had never had issues with them. They worked even since project creation

avatar image TheDreamCatcher Sep 01 '18 at 04:10 PM

You are right I'm an idiot and did not read the report correctly, I suspect your CombatStarship inherits from Starship. Something you do at line 15 in CombatStarship seems to call something from Starship. it would help to see a bit of these files. Did you modify them before the build?

avatar image AngryBeanspr0ut Sep 01 '18 at 04:32 PM

line 15 is the CombatStarship declaration. I made heavy modifications to my code since the last build. I had exited the editor while in the middle of incorporating a bunch of new changes to my code. However, next time I tried to open the editor, it failed to open. I finished incorporating my change and now my code is ready. That is when the aforementioned problem started. here is the relevant code

code.zip (3.8 kB)
avatar image TheDreamCatcher Sep 01 '18 at 05:45 PM

This compiles

I have removed a lot of things from header files. Keep them as clean as possible as the more you have in the headers the more links are created and it can take forever to compile. I have moved a lot of things from public to protected as it should be if you don't really need to access them from outside.

Hope it helps.

code2.zip (2.9 kB)
avatar image AngryBeanspr0ut Sep 01 '18 at 08:13 PM

I like the conventional things and such but i still have the same error. the generated.h cant be opened. Looking at my error list its actually a bunch of generated.h files, not just this one. But CombatStarship is the only class that can't compile due to the parent having errors

avatar image TheDreamCatcher Sep 01 '18 at 09:28 PM

You might have a buggy pre compiled header that is not being reprocessed. try to clean the solution before recompiling. Did you try my files?

avatar image AngryBeanspr0ut Sep 01 '18 at 10:05 PM

I did try your files. I had to make minor adjustments to get it to work with my code (changing the cases of methods and such), and I was able to see all of my other issues in my code (which I was unable to do after my issues started), and now my only errors are the failiure to include generated headers in most (if not all) of my classes.

avatar image TheDreamCatcher Sep 02 '18 at 03:28 AM

yes the problem here is with the UBT. it does not include the proper files where it should. there are a few fix here and there but mostly the issue is that the generated files are not properly included into the solution. The path you are looking for is in your ProjectName/Intermediate/Build/Win64/UE4Editor/Inc Here you need to include all the folders in your solution... and yes there are a bunch of them :s

this thread should provide you with what you need to properly add the files you need UE4.20 is missing the IntelliSense IncludePath for the *.generated.h files

avatar image AngryBeanspr0ut Sep 02 '18 at 06:01 PM

I pulled an older version of my game and then replaced the source with my new source. All my include issues are gone, but my only issue on my log is the combatstarship starship error thing. Screenshots::1 2

help1.png (30.5 kB)
help2.png (66.1 kB)
avatar image TheDreamCatcher Sep 02 '18 at 06:18 PM

Are you including "GameFramework/Actor.h" in you cpp file? No. In fact it has to be in your Starship.h

avatar image AngryBeanspr0ut Sep 02 '18 at 11:09 PM

It is already in my Starship.h

avatar image TheDreamCatcher Sep 02 '18 at 11:15 PM

this is very strange. Can you try to use only my code and see if it compiles? and if it does try to add some of your code and for each addition try to compile and see when it fails

avatar image mightyenigma Sep 03 '18 at 11:40 PM

Needs forward declaration?

(comments are locked)
10|2000 characters needed characters left
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