Unreal Engine 4.7.4 fails to create class

Greetings. The scenario is this:

  1. I create a flying example (c++) project.
  2. I Launch it in DevelopementEditor mode
  3. I click on Add code to project
  4. I choose AIControler for parent class
  5. I get ‘Failed to add class botAIController. Failed to automatically hot reload the ‘newProject_flying’ module.’

Is this a bug, or am I doing something wrong?

You should have some more details about why the build failed in the Output Log (Window → Developer Tools → Output Log), or your log file if you’ve since closed the editor (YourProject/Saved/Logs).

Could you post that here (or just attach your log), as that will help us know why your build is failing.

I found this:
log.txtCompilerResultsLog:Error: Error D:/Unreal Projects/UbiShips/Source/UbiShips/ShipAIController.h(11) : Error: Superclass AIController of class ShipAIController not found

Thanks.

Is your newly added ShipAIController.h file including AIController.h? (it should really have added this automatically).

It may also be that your game module doesn’t depend on “AIModule”, so UHT can’t find the parent class when parsing your headers.

It has included the “AIModule.h”

How do I check if I depend on AIModule?

Open up UbiShips.Build.cs and check to see if it’s listed in either PublicDependencyModuleNames or PrivateDependencyModuleNames - if it isn’t, add it to one of them.

That did the trick, thanks