CI: Fix vdb_view Windows build: include windows.h before GL/glu.h - #2247
Merged
kmuseth merged 1 commit intoJul 9, 2026
Merged
Conversation
GL/glu.h uses APIENTRY without defining it. This previously compiled because oneTBB (<= 2022.3) transitively included windows.h from its public headers; oneTBB 2023.0 removed that include, so APIENTRY is no longer defined when RenderModules.cc includes GL/glu.h. GL/glew.h cannot provide it either: it undefines APIENTRY at the end of the header when it was the one defining it (and the vcpkg glew package additionally patches out glew.h's internal GL/glu.h include). Include windows.h explicitly before GL/glu.h instead of relying on a transitive include. Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
swahtz
force-pushed
the
fix/vdb_view_glu_apientry
branch
from
July 7, 2026 00:10
8e8c268 to
efe2748
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
windowsCI job currently fails for every PR while compilingvdb_view, with ~100 parse errors in the Windows SDK'sGL/glu.h:These are the symptoms of
GL/glu.hbeing parsed while theAPIENTRYmacro is undefined, so the compiler treatsAPIENTRYas an identifier.Root cause
RenderModules.ccincludes<GL/glu.h>on Windows and was implicitly relying onwindows.h(which definesAPIENTRY) arriving transitively through oneTBB's public headers, via the OpenVDB headers included earlier in the file. The windows-2022 runner image update at the end of June bumped its vcpkg snapshot from oneTBB 2022.3.0 to oneTBB 2023.0.0, which no longer includeswindows.hin any public header — soAPIENTRYis no longer defined whenGL/glu.his parsed.GL/glew.h(included fromRenderModules.h) cannot provide it either:APIENTRYtemporarily, undefining it again at the end of the header when it was the one that defined it, andGL/glu.hinclude (its portfile rewritesifndef GLEW_NO_GLUto#if 0), so glu.h is not consumed inside glew.h whileAPIENTRYis still defined.Everything else was ruled out by diffing the last passing master run (June 18) against the failing runs: identical MSVC (14.44.35207), Windows SDK (10.0.26100.0), Boost 1.91, glew 2.3.1, glfw 3.4 and compile command — only the runner image and its bundled oneTBB version changed.
Fix
Include
windows.hexplicitly beforeGL/glu.hinRenderModules.ccinstead of relying on a transitive include.Camera.cc, the only other GLU consumer on Windows, is unaffected becauseglfw3.hincludesGL/glu.hwhile its ownAPIENTRYdefinition is still active.This unblocks the
windowsjob for all currently open PRs (e.g. #2219, #2241, #2244) once they rebase or re-run against master.