You can try "export CGO_ENABLED=0" (and maybe ./make.bash instead of
./all.bash).
I think this doesn't build all, so if you are using the wrong packets,
this won't help you.
Norbert
I do this for three different servers; I develop on my mac and build (via a script, of course) with CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $NAME -o ${NAME}_linux and then I copy it over (and the harness notices and restarts). Works quite nicely. Compared to my experiences trying to cross-compile with GCC, it's practically a pleasure.
what about with cgo enabled?
what about with cgo enabled?
On Wed, Mar 7, 2012 at 2:10 PM, Dorival Pedroso <dorival...@gmail.com> wrote:what about with cgo enabled?CGO is not available for cross compiling for reasons which I don't understand well enough to summarize. I also find that it makes a Go application somewhat less "cross platform" and so I don't use it myself. I believe it only needs to be explicitly disabled when cross compiling something that would otherwise use CGO, i.e. something that uses the net library (which is almost everything I do).
So if you're cross compiling gcc is called "gcc", cgo will work? Unfortunately, pretty much everything I write uses net :/