Skip to content

frontend: Include windows.h before shellapi.h in the obs-main Windows PCH - #2359

Merged
zackees merged 1 commit into
masterfrom
coord/obs-main-pch-windows-order
Oct 25, 2026
Merged

zackees merged 1 commit into
masterfrom
coord/obs-main-pch-windows-order

Conversation

@zackees

@zackees zackees commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Fixes the Windows x64 app build on master (reported in #1395).

What

The nightly full run on bd029c8 (run 40162888607) fails Build 🧱 / Windows 🪟 (x64) in frontend.windows-obs-main+.hpp.cpp:

shellapi.h(104,1): error C2086: 'int EXTERN_C': redefinition
shellapi.h(104,1): error C2146: syntax error: missing ';' before identifier 'DECLSPEC_IMPORT'

#2176 (2f28dc2) moved obs-main's Windows startup into its own unity group. Its PCH frontend/build/frontend-windows-obs-main.pch.hpp kept obs-app.cpp's order, <shellapi.h> before <windows.h>. In obs-app.cpp an earlier header had already brought in windows.h; in the new group nothing does, so shellapi.h is parsed without EXTERN_C/DECLSPEC_IMPORT. The nightly passed on 56732d6 (10-24 04:38, before #2176) and fails on the next one.

Fix

Include <windows.h> (with WIN32_LEAN_AND_MEAN) before <shellapi.h>. No source or behaviour change.

Verification

  • RED: the nightly log above.
  • GREEN: PR CI does not build the Windows app (AGENTS.md: the full app builds never run from a PR path), so the proof is the next scheduled or workflow_dispatch full run. The new order matches frontend-windows-autoupdatethread.pch.hpp. (frontend-windows-platform.pch.hpp also lists shellapi.h first, but an earlier include there already brings in windows.h, so it builds.) ./lint passes.

The other two failures in that nightly (canonical_remux_queue_runs_unchanged on macOS/Windows) were fixed by #2355. Build-only, so no features-ledger line.

… PCH

#2176 moved obs-main's Windows startup into its own unity group and
kept obs-app.cpp's include order, shellapi.h before windows.h. In
obs-app.cpp an earlier header had already pulled in windows.h; in
the new group nothing does, so shellapi.h sees no EXTERN_C or
DECLSPEC_IMPORT and the Windows x64 app build fails (C2086/C2146 in
shellapi.h, nightly run 40162888607). PR CI never builds the app, so
only the nightly saw it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant