Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build release template on windows 11 with error C2440: 'reinterpret_cast': cannot convert from 'XrAction' to 'uint64_t' #102361

Open
39george opened this issue Feb 3, 2025 · 1 comment · May be fixed by #102384

Comments

@39george
Copy link

39george commented Feb 3, 2025

Tested versions

  • Reproducible on master branch, commit 1586c56
  • Not reproducible on 4.3 stable.

System information

godot (master branch, commit 1586c56) - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Forward+) - integrated AMD Radeon(TM) 780M (Advanced Micro Devices, Inc.; 31.0.22048.10001) - AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics (16 threads)

Issue description

I ran the command scons platform=windows target=template_release arch=x86_32, but after some time, an error occurred:

scons platform=windows target=template_release arch=x86_32
scons: Reading SConscript files ...
Auto-detected 16 CPU cores available for build parallelism. Using 15 cores by default. You can override it with the `-j` or `num_jobs` arguments.
Using SCons-detected MSVC version 14.3, arch x86_32
Building for platform "windows", architecture "x86_32", target "template_release".
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
Compiling modules\text_server_adv\text_server_adv.cpp ...
...
many lines...
...
Compiling modules\openxr\extensions\openxr_mxink_extension.cpp ...
←[34mCompiling ←[1mmodules\openxr\extensions\openxr_palm_pose_extension.cpp←[22;23;24;29m ...←[0m♪◙Compiling modules\openxr\extensions\openxr_pico_controller_extension.cpp ...
Compiling modules\openxr\extensions\openxr_valve_analog_threshold_extension.cpp ...
←[34mCompiling ←[1mmodules\openxr\extensions\openxr_visibility_mask_extension.cpp←[22;23;24;29m ...←[0m♪◙Compiling modules\openxr\extensions\openxr_wmr_controller_extension.cpp ...
Compiling modules\openxr\extensions\platform\openxr_vulkan_extension.cpp ...
modules\openxr\openxr_api_extension.cpp(215): error C2440: 'reinterpret_cast': cannot convert from 'XrAction' to 'uint64_t'
modules\openxr\openxr_api_extension.cpp(215): note: Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
modules\openxr\openxr_api_extension.cpp(296): error C2440: 'reinterpret_cast': cannot convert from 'XrSwapchain' to 'uint64_t'
modules\openxr\openxr_api_extension.cpp(296): note: Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
scons: *** [modules\openxr\openxr_api_extension.windows.template_release.x86_32.obj] Error 2
Compiler terminating.  Please wait........... Abort complete.
scons: *** [modules\text_server_adv\text_server_adv.windows.template_release.x86_32.obj] Error 4
scons: Build interrupted.
scons: building terminated because of errors.
scons: writing .sconsign file.
INFO: Time elapsed: 00:01:48.27

By the way, 4.3 stable works fine

Steps to reproduce

Run scons platform=windows target=template_release arch=x86_32

Minimal reproduction project (MRP)

No project.

@akien-mga
Copy link
Member

akien-mga commented Feb 3, 2025

Likely caused by #101503, CC @devloglogan @dsnopek.

XrAction seems to be a typedef with:

#if !defined(XR_DEFINE_HANDLE)
#if (XR_PTR_SIZE == 8)
    #define XR_DEFINE_HANDLE(object) typedef struct object##_T* object;
#else
    #define XR_DEFINE_HANDLE(object) typedef uint64_t object;
#endif
#endif

XR_DEFINE_HANDLE(XrAction)

Here we're in the XR_PTR_SIZE == 4 case on Windows x86_32 so the reinterpret_cast raises an error because it's not needed... (Should probably be a warning if you ask me but either way this needs to be reworked.)

While at it, action_hanlde is typoed.

@devloglogan devloglogan self-assigned this Feb 3, 2025
@devloglogan devloglogan linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Status: For team assessment
Development

Successfully merging a pull request may close this issue.

4 participants