You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Go are you using (go version)? go version go1.5.1 darwin/amd64 and go version devel +3e6334e Tue Oct 6 07:05:51 2015 +0000 darwin/amd64
What operating system and processor architecture are you using?
OS X 10.10.5, 64 bit.
What did you do?
Have a simple go program with cgo (I think is mainly cgo). The code I used:
In order to use cgo when cross-compiling, you need to set the CC environment variable to a Darwin -> GNU/Linux cross-compiler. You are using a Darwin native compiler, which can not work. Even if the build succeeded, the resulting code would not run on GNU/Linux.
For people with the same issues, I ended up just running linux inside VirtualBox. I tried using gcc, installed via Homebrew, but that didn't work either.
What version of Go are you using (go version)?
go version go1.5.1 darwin/amd64
andgo version devel +3e6334e Tue Oct 6 07:05:51 2015 +0000 darwin/amd64
What operating system and processor architecture are you using?
OS X 10.10.5, 64 bit.
What did you do?
Have a simple go program with cgo (I think is mainly cgo). The code I used:
Then try to cross compile from OS X to linux, running:
GOOS=linux go build
.What did you expect to see?
A build linux binary.
What did you see instead?
Error message:
Extra notes:
Cross compiling to windows works just fine.
Output of
GOOS=linux go build -v
:Output of
GOOS=linux go build -x
:The text was updated successfully, but these errors were encountered: