UBT error .generated.h not found when adding new files

When adding new source files, for example #my_new_and_shiny_class to the filesystem and calling the service to rebuild the XCode project, UBT generates an error : my_new_and_shiny_class.generated.h not found.

This is a showstopper, because I can’t build anymore.

Hey ,

Are you adding the new files through UE4 or through XCode?

Kyle, I’m adding to the filesystem. That’s why I call the service to rebuild the project.

Can you try adding a new class to the project via the editor?

You can do this by going to your Content Browser, select the C++ Classes folder then the folder that is the same as your project, then, in the window where the other classes are, right-click → New C++ Class…

Kyle, yes I do that all the time for simple projects. Unfortunately my current project has some hundred existing files, so I can’t take this way.
Or maybe I misunderstood this - can I add multiple existing source files with this method?

I misunderstood that you are trying to add existing files. Sorry about that.

Can you try these steps:

  • Close XCode (after having added all the files you want to)
  • Navigate to where your game project is.
  • Right click on the .uproject and mouse down to “services”
  • Select, “Generate Xcode Project”
  • When that is done, re-open Xcode and try to compile again.

Here’s a screenshot:

Kyle, that’s what I described in my first post: “calling the service to rebuild the XCode project”.
Is this working on your machine with 4.13?
If so, I might test the behaviour with another project.
Thank you for helping.

Hey again,

I tested on the machine here and Generate Xcode Project appears to be working.

If you can say, what files are you trying to add to the project? Is it a plugin or another project? Or, something completely different?

Thanks.

Hey ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

I can confirm, that a fresh project is working. My other project has some hundred files, so the failure might have a different reason - have to investigate. Thanks for helping.