Oculus Rift support broken since beta 6?

I have the following line in my custom camera class:

GEngine->HMDDevice->GetCurrentOrientationAndPosition( head_orientation, position );

This now fails to compile:

1>C:\Program Files\Unreal Engine\4.0\Engine\Source\Runtime/HeadMountedDisplay/Public/IHeadMountedDisplay.h(21): error C2079: 'IHeadMountedDisplay' uses undefined class 'HEADMOUNTEDDISPLAY_API'

Looking at the class definition:

class HEADMOUNTEDDISPLAY_API IHeadMountedDisplay : public IModuleInterface, public IStereoRendering

…and doing a search for HEADMOUNTEDDISPLAY_API in the source shows that it’s not defined anywhere in UE4.

Oculus Rift support definitely works.

That’s strange. I’ll investigate this more tomorrow. For now, to your game’s MyGame.Build.cs file, please try adding:

PrivateIncludePathModuleNames.Add( “HeadMountedDisplay” );

That will tell UnrealBuildTool that you your module needs to have the HEADMOUNTEDDISPLAY_API macro defined because it is (indirectly) using those headers. You should not need to do this, so there appears to be a regression.

–Mike

1 Like

I hit the same error and Mike’s suggestion worked for me.