LoginSignup
8
9

More than 5 years have passed since last update.

Golangでクロスコンパイルに失敗した場合のTips

Posted at

Windows環境でLinux向けにgolangのバイナリをビルドしようとしたときに
> go build src/hogehoge.go
go build runtime: linux/amd64 must be bootstrapped using make.bat

こんなメッセージが出て悲しい思いをしたときに。

GOARCH=amd64, GOOS=linux になっていることを確認して
> go tool dist install -v pkg/runtime
> go install -v -a std

これでLinux用のランタイムがGO_ROOT/pkg下にインストールされるのでコンパイルできるようになるようです。

元ネタ:http://stackoverflow.com/questions/20829155/how-to-cross-compile-from-windows-to-linux

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9