-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Errors cross compile to windows 64 #303
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
Comments
Are you using mingw64 C compiler on linux? |
I wasn't. 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. |
@tiaguinho you can build your app in go-mingw Docker container which contains all necessary MinGW deps]. |
* use docker image that has mingw-compiling configured * for more, see mattn/go-sqlite3#303
Anyone know how to fix this? @tiaguinho solution doesn't seem to work (I'm guessing that's why it has so many downvotes). Building in the go-mingw docker container works but is extremely slow. Would like to be able to build locally. |
@williambrode mount your GOPATH (or use Docker volume) to keep Go build cache. See https://github.com/x1unix/docker-go-mingw#go-build-cache |
@williambrode Should be something like this:
Be sure to set |
@rittneje thank you very much, its worked for me, i am using linux ubuntu. first installed the package then compiled for windows as follows.
|
@rittneje this works thanks! But it doesn't seem to work for GOARCH=arm64. |
Works on amd64. But can anyone tell me what is the difference between gcc-mingw-w64 and mingw-w64 package in debian |
@navaneeth-dev |
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?
The text was updated successfully, but these errors were encountered: