Issue Building Unreal Engine with Magic Leap Plugin

Give us as much detail as possible regarding the issue you're experiencing:

The Unreal Engine source code does not compile with the Magic Leap 2 plugin for Unreal in the /Engine/Plugins/Runtime folder. I get numerous C2065 "Undeclared Identifier" errors. This leads me to believe that the Android linkage specified in the getting started guide isn't working. I've followed the guide twice at this point, making sure that I'm setting the correct environment variables, editing line 86 of SetupAndroid.bat and running it, have the right version of Android Studio installed, etc. and received this error both times. Can anyone help me narrow down what I'm doing wrong?

Magic Leap SDK version: 1.2.0
Unreal Engine version: 5.1.1
ML2 OS version: N/A

Error messages from logs (syntax-highlighting is supported via Markdown):

1>[3/41] Compile Module.MagicLeapOpenXR.cpp
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(21): error C3646: 'GlobalDimmerFrameEndInfo': unknown override specifier
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(21): error C2059: syntax error: '{'
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(21): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(22): error C3646: 'FrameEndInfo': unknown override specifier
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(22): error C2059: syntax error: '{'
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.h(22): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.cpp(33): error C2065: 'XR_EXT_LOCAL_FLOOR_EXTENSION_NAME': undeclared identifier
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.cpp(34): error C2065: 'XR_ML_FRAME_END_INFO_EXTENSION_NAME': undeclared identifier
1>C:\Program Files\Epic Games\UE_5.1_Source\Engine\Plugins\Runtime\MagicLeapOpenXR\Source\MagicLeapOpenXR\Private\MagicLeapOpenXR.cpp(35): error C2065: 'XR_ML_GLOBAL_DIMMER_EXTENSION_NAME': undeclared identifier

Thank you for that information. We will update our documentation to list the SDK Compatibility version more clearly.

If you wish to use Unreal Engine 5.1 then you will need to use the Magic Leap 1.1 SDK , if you are using the 1.2.0 SDK you should use Unreal Engine 5.3 instead.

You will need to remove the old plugin folder from the Magic Leap folder before recompiling with the other SDK version. Getting Started | MagicLeap Developer Documentation

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.