(SOLVED) 'HeadMountedDisplayTypes.generated.h': No such file or directory

I am trying to build a VR game, we have some c++ code that requires using the headmountedDisplayfunctionlibrary.h . If I include that I get this error and can not use any of its methods.




UATHelper: Packaging (Windows (64-bit)): ExternalAppLoader.cpp (0:01.01 at +0:00)
UATHelper: Packaging (Windows (64-bit)): d:\epiclaunchergames\ue_4.23\engine\source\runtime\headmounteddisplay\public\HeadMountedDisplayTypes.h(9): fatal error C1083: Cannot open include file: 'HeadMountedDisplayTypes.generated.h': No such file or directory
UATHelper: Packaging (Windows (64-bit)):
UATHelper: Packaging (Windows (64-bit)): Error executing D:\EpiclauncherGames\UE_4.23\Engine\Build\Windows\cl-filter\cl-filter.exe (tool returned code: 2)
UATHelper: Packaging (Windows (64-bit)): ExternalAppLoader.gen.cpp (0:00.95 at +0:01)
UATHelper: Packaging (Windows (64-bit)): d:\epiclaunchergames\ue_4.23\engine\source\runtime\headmounteddisplay\public\HeadMountedDisplayTypes.h(9): fatal error C1083: Cannot open include file: 'HeadMountedDisplayTypes.generated.h': No such file or directory
UATHelper: Packaging (Windows (64-bit)):
UATHelper: Packaging (Windows (64-bit)): Error executing D:\EpiclauncherGames\UE_4.23\Engine\Build\Windows\cl-filter\cl-filter.exe (tool returned code: 2)
UATHelper: Packaging (Windows (64-bit)): ---------------------- Done ----------------------
UATHelper: Packaging (Windows (64-bit)):
UATHelper: Packaging (Windows (64-bit)): Rebuild All: 0 succeeded, 1 failed, 0 skipped



Do you have “HeadMountedDisplay” as one of the modules in your Build.cs file?

I add something like this?


PrivateDependencyModuleNames.AddRange(new string] {"HeadMountedDisplay"});

1 Like

Yeah. I would assume there are already a few modules listed in both Public and Private module dependencies. You can simply add “HeadMountedDisplay” to an existing list.

Ok that totally worked! thank you! I was only adding it in the privatedependencymodulenames but once I did it in the public one as well it worked. thank you!

1 Like

Not a problem. Glad it worked. Yeah, usually when I run into build issues using UE4 “stuff,” I always remind myself: Does it belong to a module that you don’t have in your Build.cs file? And I end up looking it up in the UE4 docs, finding the module name, adding it in, and all is well with the world once again. This won’t be the last time you’ll run into this. Best of luck.

2 Likes

what do you mean add it to an existing list? what list? where? I have this issue

Hello, the list is the module list. The file to edit is:

“YourProject.Build.cs”

Your issue is maybe different on 5.3 “HeadMountedDisplay” got renamed to “XRBase”

2 Likes

In my Unreal 5.3 plugin build.cs file I have added the “HeadMountedDisplay” module like this:

 PublicDependencyModuleNames.AddRange( new string[]{"Core", "HeadMountedDisplay"});

PrivateDependencyModuleNames.AddRange(new string[{CoreUObject","HeadMountedDisplay"}

I still get the error Cannot open include file: ‘HeadMountedDisplayFunctionLibrary.h’: No such file or directory

Is this required in your plugin or in your project? In 5.3 you should use “XRBase”

1 Like

It was required in my plugin and Thank you very much “XRBase” is the solution.

Hi!

I have the same issue on UE5.3.2
i use XRBase module like this

PublicDependencyModuleNames.AddRange(new string { “Core”, “CoreUObject”, “Engine”, “InputCore”, “XRBase”});

but i still get the error Cannot open include file “HeadMountedDisplayFunctionLibrary.h”