OpenXR SDK does not compile on Windows without `XR_USE_GRAPHICS_API_D3D11`/similar
See original GitHub issueHi there! This is a fairly minor issue, but it caused me a little grief recently. I’ve been integrating the SDK into a non-DX codebase using a different build system and used a minimal set of defines to add Windows support:
'API_NAME="OpenXR"',
"XR_USE_TIMESPEC",
"XR_CURRENT_API_MAJOR_VERSION=1",
"XR_CURRENT_API_MINOR_VERSION=0",
"XR_CURRENT_API_PATCH_VERSION=13",
"XR_USE_GRAPHICS_API_OPENGL",
"XR_USE_PLATFORM_WIN32",
"XR_OS_WINDOWS",
"WIN32",
"_WINDOWS",
However, this will not compile. openxr/openxr_platform.h
refers to IUnknown
, which isn’t pulled in by xr_dependencies.h
with the above set of defines. Defining the D3D defines pulls in the DX headers, which in turn pulls in the headers for IUnknown
.
Again, really minor, but might save someone else in the same predicament some trouble 😅
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Compiling openexr for 64-Bit Platforms - MSDN - Microsoft
I'm trying to compile OpenEXR (www.openexr.com) for Win64 with Visual Studio ... My latest attempt was to install SP1 for VS/SDK, no change....
Read more >Help with building hello_xr Sample - Python3 not found
I am working through this hello_xr Sample App (https://developer.oculus.com/documentation/native/android/mobile-build-run-hello-xr-app/) but ...
Read more >Installation Directly | OpenXR - GitHub Pages
Build the OpenXR SDK with cmake, this example uses ninja. ... This command will install required and some optional dependencies that will enable...
Read more >Can't build Unreal Engine 4 project with Microsoft OpenXR ...
I am able to compile all project source code from within the editor successfully. However, when I attempt to package my project, I...
Read more >chromium / external / github.com / KhronosGroup / OpenXR-SDK
(OpenXR-SDK-Source PR 274) - Loader: Fixed incorrect return value when no broker is present on Android but runtime defined via active_runtime.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
so that’s a good question. The required headers/includes are marked up in the XML but aren’t being written to the header files for some reason. Can you open an issue for adding those includes to openxr_platform.h? It is annoying to work around for sure.
This issue also appears to affect users of the OpenXR headers, not just the loader itself. Somebody on the flightgear mailing list reported it with MSVC 2019 (16.11.18), with OpenXR 1.0.24: https://sourceforge.net/p/flightgear/mailman/message/37697116/ Visual studio community 2022 didn’t seem affected. Including unknwn.h before openxr_platform.h worked around it, but it seems flawed to expect openxr apps to anticipate includes that might be required on windows for extensions they don’t use or future extensions they may not know about.
Should the openxr_platform.h header not include unknwn.h itself?