Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to SDL on 64bit Windows Instructions Unclear #599

Open
GustavBW opened this issue Apr 29, 2024 · 1 comment
Open

How to SDL on 64bit Windows Instructions Unclear #599

GustavBW opened this issue Apr 29, 2024 · 1 comment

Comments

@GustavBW
Copy link

TLDR: I have gotten it to work now, but found the instructions unclear.

Go version:
go1.21.0 windows/amd64

Go-SDL2 version:
v2?

SDL2 version:
SDL2-devel-2.30.2-mingw

OS:
Windows 11

Architecture:
64bit

Hi, I've used Golang itself for some time but never any native bindings or dll's or anything like that. I might be overly pedantic in my understanding, but since I have no understanding in the first place, I had some issues following the setup instructions.

I've followed the instructions as described in the main readme here, and the first lapse in my understanding is the mention of a mingw64 folder. What I have is H:/msys64/mingw64, which is the default path when you install MinGW (aside from the drive that is) so I assumed that was what was meant.

The second lapse is step 3 mentioning putting some mingw-w64 binaries on the system path. I have no such folder, but there was a bin in msys64/mingw64/bin so I assumed it was that one.

And third and finally, the SDL2 github has no win64 release. At first this stumped me a lot because I didn't know that the SDL2-2.30.2-win32-x64 release would work (I thought win32 was officially out-dated and unsupported) so I went searching elsewhere and tried a bunch of different .dll's from arguably questionable sources.

Its not a lot, and someone with more experience with this would breeze through the instructions, but it could be nice if they were a little more explicit with the details.

@Lundis
Copy link
Contributor

Lundis commented Jul 20, 2024

I gave up making official builds for windows in windows. instead I cross-compile statically on Ubuntu when I need a windows build that works on any machine:

    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 game.exe -ldflags "-s -w" -tags osusergo,netgo,static

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

No branches or pull requests

2 participants