Unable to find Generated file from other module

I am trying to separate our game into 2 different modules. One is for the game and one is for the editor. Most of it is working except when I include any files from the game module from a file in the editor module, it can’t find the “generated.h”. Any help would be very appreciated. Thanks.

Have You fixed it? I’m currently having the same problem.

Yeah ditto…any luck?

Oh man… yes… I did get it working, but I can’t remember how. I now have the two projects working.

I had to make a file called UE4Games.uprojectdirs and put this in it:

; These folders will be searched 1 level deep in order to find projects
; UnrealBuildTool will store the following information:
; - Project name
; - Location of project
; - Whether it has code or not
; - TargetNames contains at the project location
;
./
Engine/Source/

That goes in the root level.

Then… I think I just added source files into a different folder and ran GenerateProjectFiles. There may be something else I’m missing though. Sorry about that.

Well hey, that’s better than nothing! Just might help me get on the right path. Thanks for responding.

I’ve got it working by adding paths to the game module source files in the PrivateIncludePaths of the editor’s Build.cs. besides having the game module added to the PublicDependencyModuleNames. Important thing is to also add XXX_API macro (where XXX is the name of your game module) to the class/struct/method definitions you want to export from the game module (make accessible by the editor module).

Thanks for your response man. Unfortunately I still can’t get mine to compile after following your advice. I have a bit of a different situation, but I think the fundamental issue is the same, so maybe you’ll have some insight…

I’m trying to derive from UAnimGraphNode_Base (an original editor class) in our MHEditor module, and it can’t find the AnimGraphNode_Base.generated.h. I’ve tried adding the path to AnimGraphNode_Base.h in the MHEditor.Build.cs file, but no luck.

I could probably figure it out if I knew how the build tool went about finding the generated files to begin with, as they’re obviously put in temporary directories (Intermediate/…) that aren’t specified in Build.cs.

Do you add AnimGraph module to PublicDependencyModuleNames in your Build.cs file? This is all you should be required to do.

Ahh, yup that it did it! Should have known…So evidently the module is what contains the generated header paths. Thanks!

Yes, adding the module to your module rules tells the UBT, which in turn tells the compiler, where to look for all the module related files :slight_smile: