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

Failed to cross-compile to Windows i386: GetDoubleClickTime #440

Open
20kdc opened this issue Dec 6, 2019 · 3 comments
Open

Failed to cross-compile to Windows i386: GetDoubleClickTime #440

20kdc opened this issue Dec 6, 2019 · 3 comments
Labels
bug This issue describes a bug in the project

Comments

@20kdc
Copy link

20kdc commented Dec 6, 2019

On an Ubuntu 19.10 (Eoan Ermine) system, the following command:
CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -v -tags static -ldflags "-s -w"
fails to build https://github.com/20kdc/CCUpdaterUI (Please be noted: If you wish to test this specific application, it expects my fork of CCUpdaterCLI) with:

/usr/bin/i686-w64-mingw32-ld: ../../veandco/go-sdl2/sdl/../.go-sdl2-libs/libSDL2_windows_386.a(SDL_mouse.o):(.text+0xa1): undefined reference to `GetDoubleClickTime'

Note: This issue mostly exists to document the workaround, which is:

Overwriting the .go-sdl2-libs files with the relevant MinGW static libraries (not the .dll-postfixed ones) from https://www.libsdl.org/download-2.0.php works.

Specifically:
If an issue occurred with GetDoubleClickTime:

@veeableful
Copy link
Contributor

Hi @20kdc, thanks for the workaround. It does work! I tested it by compiling the library (e.g. cd $GOPATH/src/github.com/veandco/go-sdl2/sdl then run CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go install -v -tags static -ldflags "-s -w".

Do you think we could simply update the Windows 32-bit .a files with the ones from the website, @gen2brain? Or did you compile the static libraries yourself with a special way?

@gen2brain
Copy link
Collaborator

gen2brain commented Dec 7, 2019

Hi @veeableful , libs are compiled with minimal dependencies (i.e. without smpeg, flac, mikmod, modplug etc.) and made to work by default with libmpg123. All libs are cross-compiled on Linux (except for darwin but I can now also cross-compile for darwin on Linux).

I don't have any automatic procedure for the build, just some notes, will try to compile and update everything again, not sure when will I find time to do that though.

btw. that GetDoubleClickTime is strange, that is in user32 and it does link that lib, maybe order is important for that one.

@veeableful
Copy link
Contributor

I see, thank you @gen2brain. Let me know if I can help with the build. I certainly have some time to spare 😁

@veeableful veeableful added the bug This issue describes a bug in the project label Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a bug in the project
Projects
None yet
Development

No branches or pull requests

3 participants