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 master branch due to expected unqualified-id errors in camera_3d_gizmo_plugin.cpp on Windows llvm-mingw #95766

Closed
Anutrix opened this issue Aug 18, 2024 · 1 comment · Fixed by #95768

Comments

@Anutrix
Copy link
Contributor

Anutrix commented Aug 18, 2024

Tested versions

  • Reproducible in latest master 1bd740d.
  • Not reproducible in branch 4.3 on v4.3.1.rc.custom_build [ff9bc04].

System information

Godot master (1bd740d) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated Radeon RX 570 Series (Advanced Micro Devices, Inc.; 31.0.21916.2) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

Issue description

It fails with following when trying to build godot with llvm-mingw:

> scons dev_build=yes use_mingw=yes
scons: Reading SConscript files ...
Automatically detected platform: windows
Auto-detected 24 CPU cores available for build parallelism. Using 23 cores by default. You can override it with the -j argument.
Using MinGW, arch x86_64
Building for platform "windows", architecture "x86_64", target "editor".
NOTE: Developer build, with debug optimization level and debug symbols (unless overridden).
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[Initial build] Compiling editor\plugins\gizmos\camera_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\ray_cast_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\reflection_probe_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\shape_cast_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\soft_body_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\spring_arm_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\sprite_base_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\vehicle_body_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\visible_on_screen_notifier_3d_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\gizmos\voxel_gi_gizmo_plugin.cpp ...
[Initial build] Compiling editor\plugins\tiles\atlas_merging_dialog.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_atlas_view.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_data_editors.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_map_layer_editor.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_proxies_manager_dialog.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_set_atlas_source_editor.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_set_editor.cpp ...
[Initial build] Compiling editor\plugins\tiles\tile_set_scenes_collection_source_editor.cpp ...
[Initial build] Compiling editor\plugins\tiles\tiles_editor_plugin.cpp ...
[Initial build] Compiling editor\project_manager\project_dialog.cpp ...
[Initial build] Compiling editor\project_manager\project_list.cpp ...
[Initial build] Compiling editor\project_manager\project_tag.cpp ...
[Initial build] Compiling editor\project_manager\quick_settings_dialog.cpp ...
[Initial build] Compiling editor\themes\editor_color_map.cpp ...
[Initial build] Generating editor\themes\builtin_fonts.gen.h ...
ERROR: clang-18: warning: argument unused during compilation: '-mwindows' [-Wunused-command-line-argument]
editor\plugins\gizmos\camera_3d_gizmo_plugin.cpp:116:15: error: expected unqualified-id
  116 |                 Vector3 far = aspect == Camera3D::KeepAspect::KEEP_WIDTH ? Vector3(4096, 0, -1) : Vector3(0, 4096, -1);
      |                             ^
editor\plugins\gizmos\camera_3d_gizmo_plugin.cpp:119:73: error: expected expression
  119 |                 Geometry3D::get_closest_points_between_segments(Vector3(0, 0, -1), far, s[0], s[1], ra, rb);
      |                                                                                       ^
2 errors generated.

scons: *** [editor\plugins\gizmos\camera_3d_gizmo_plugin.windows.editor.dev.x86_64.o] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:00:23.41]

Not sure if this specific to llvm-mingw as I don't use MSVC. It used to work fine with this compiler before. Note that I haven't built godot in a while(about 2k commits ago). Tried clean build but it didn't help.

Update: The change between 4.3 and master for that file seems to be from #90690 .

Steps to reproduce

  1. Add llvm-mingw to path.
  2. Switch to godot repo directory and checkout into master branch.
  3. Run scons dev_build=yes use_mingw=yes in godot folder.

Minimal reproduction project (MRP)

NA

@AThousandShips
Copy link
Member

This is because far is a macro in some Windows environments, it's been a serious issue across versions in the past and was fixed, but seems the general improvement wasn't complete, I'll write up a quick fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants