Skip to content

ci(windows): link SDL2main before SDL2 (fixes main after PR #3)#4

Merged
eggfly merged 1 commit into
mainfrom
fix/windows-sdl2main-order
Jun 3, 2026
Merged

ci(windows): link SDL2main before SDL2 (fixes main after PR #3)#4
eggfly merged 1 commit into
mainfrom
fix/windows-sdl2main-order

Conversation

@eggfly

@eggfly eggfly commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

PR #3 merged without this follow-up fix (it was pushed to the branch during a network outage, after the merge). main's windows-x64 job is now failing.

Problem

Removing SDL2_image (PR #3) exposed a latent MinGW link-order bug:

libSDL2main.a(SDL_windows_main.c.obj): undefined reference to `SDL_strlen'
... SDL_SetMainReady, SDL_free, SDL_ShowSimpleMessageBox, ...

libSDL2main.a references SDL symbols but was linked after libSDL2. MinGW's ld is single-pass. SDL2_image at the tail used to re-pull the SDL archive and mask the ordering bug; with it gone, the references go unresolved.

Fix

Link SDL2::SDL2main before SDL2::SDL2. One-line ordering change in the dynamic-link branch (Linux/Windows). macOS static path unaffected.

macOS arm64 / linux / web were all green in PR #3 — this only unblocks windows-x64.

Removing SDL2_image exposed a latent link-order bug: libSDL2main.a
references SDL symbols (SDL_strlen, SDL_SetMainReady, …) but was linked
after libSDL2. MinGW's ld is single-pass, so the references went
unresolved. SDL2_image at the tail used to re-pull the SDL archive and
mask it. Put SDL2main before SDL2. macOS (static path) unaffected.
@eggfly eggfly merged commit 5f22658 into main Jun 3, 2026
5 checks passed
@eggfly eggfly deleted the fix/windows-sdl2main-order branch June 3, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant