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

Errors cross compile to windows 64 #303

Closed
tiaguinho opened this Issue May 9, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@tiaguinho

tiaguinho commented May 9, 2016

I'm trying cross compile from linux to windows 64 and the following error has occurred

runtime/cgo
gcc: error: unrecognized command line option ‘-mthreads’

Any ideias?

@tiaguinho tiaguinho changed the title from Erros cross compile to windows 64 to Errors cross compile to windows 64 May 9, 2016

@mattn

This comment has been minimized.

Owner

mattn commented May 10, 2016

Are you using mingw64 C compiler on linux?

@tiaguinho

This comment has been minimized.

tiaguinho commented May 10, 2016

I wasn't.
But after some research I found a page in stackoverflow so i try.
First install this two packages

apt-get install gcc-multilib
apt-get install gcc-mingw-w64

After that I use this command to compile

GOOS=windows GOARCH=386 CGO_ENABLED=1 CXX_FOR_TARGET=i686-w64-mingw32-g++ CC_FOR_TARGET=i686-w64-mingw32-gcc go build

This works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment