Skip to content

SDL2 can't be built on Windows at the momentΒ #277

@kapkekes

Description

@kapkekes

Problem

Can't build SDL2.

Description

I tried to build this library using Haskell Stack on Windows 11, but encountered a problem:

sdl2> C://Users//vashu//AppData//Local//Programs//stack//x86_64-windows//ghc-9.2.5//mingw//bin/ld.exe: C:\Users\vashu\AppData\Local\Programs\stack\x86_64-windows\msys2-20220904\mingw64\lib/libSDL2main.a(SDL_windows_main.c.obj):(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_chk_guard]+0x0): undefined reference to `__stack_chk_guard'
sdl2> collect2.exe: error: ld returned 1 exit status

(full logs are here: log.txt)

As far as I can tell, this should be a problem with the SDL2 from MinGW64 repository. Sadly, I don't know how to contact its maintainers.

Steps to reproduce:

  1. Install Stack: https://docs.haskellstack.org/en/stable/#how-to-install-stack
  2. Execute:
stack exec -- pacman -Syu
stack exec -- pacman -S msys2-keyring
stack exec -- pacman -S mingw64-w64-x86_64-pkg-config mingw64-w64-x86_64-SDL2
  1. Try to install SDL2:
stack install sdl2

Workaround solution

idea by @toolcreator: #277 (comment)

the newest working version found by @jship: #277 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions