Answer the question
In order to leave comments, you need to log in
What is the problem with cross compiling in golang?
Hello, I can't figure out why cross compilation in golang doesn't work.
For example (a working machine with Linux mint, go version 1.5 ): GOOS=linux GOARCH=amd64 go build file.go
I get a file binary that runs successfully on a working machine either with a full path or ./file
But when I transfer it to a debian server (there I don't have go installed) and I chmod +x (with the full path or from the current folder) and try to do as above, writes: -bash: *waytofile*: No such file or directory
I try to set values for both 32 bits and 64 - same.
In the same way, I tried to compile under win, file.exe was created, but on Windows it did not start, if you run it from the command line, a message was written something like: this is a 16-bit file and cannot start ...
What is the problem and how to compile normally at least for a server?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question