-
Notifications
You must be signed in to change notification settings - Fork 18k
Windows cross compiling not working with libraries that use CGO #40616
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
|
Could you please explain how to use these and what I would have to do? Thanks! |
You first have to find and install a C/C++ cross compiler that targets windows. Then set the CC/CXX enviromental variables to point to the correct compiler. The issue tracker is not used for questions so please see https://github.com/golang/go/wiki/Questions if you need someone to walk you through the process of installing the crosscompiler and setting things up. |
Closing this issue, and would like to encourage you to follow up on the list of forums suggested by @AlexRouSg. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I believe I have the latest release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have written a simple Pong program using raylib-go. I have a Mac running amd64, and I am trying to cross-compile for windows, amd64.
My program:
Program
When I run the command
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -o pong.exe pong.go
, I get the errorWhen I try to compile without CGO_ENABLED (
GOOS=windows GOARCH=amd64 go build -o pong.exe pong.go
), I get the errorWhat did you expect to see?
I expected to find a file called "pong.exe", which should have been a valid windows executable. I expect that something like raylib should work since it is known for being cross-platform.
What did you see instead?
I got errors in cross-compiling
The text was updated successfully, but these errors were encountered: