veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

ttf: Added missing rpcrt4 dependency for static linking for windows #560

Closed Lundis closed 1 year ago

Lundis commented 1 year ago

At least when cross-compiling statically to windows on linux, it fails on linking TTF because it cannot find __imp_uuidcreate, which is part of mingw's librpcrt4. Adding it fixed the issue.

Details of my cross-compile setup on ubuntu 22.10:

sudo apt-get install mingw-w64 g++-mingw-w64-x86-64
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=/usr/bin/x86_64-w64-mingw32-gcc go build -v -o program.exe -ldflags "-s -w" -tags static
veeableful commented 1 year ago

Thank you @Lundis for the pull request! I will merge it now.