Home >Backend Development >Golang >How to Fix the 'runtime: linux/amd64 must be bootstrapped' Error During Go Cross-Compilation from Windows?
Cross-Compiling from Windows to Linux: Resolving the "runtime: linux/amd64 must be bootstrapped" Error
When attempting to cross-compile from Windows to Linux with Go 1.2, users may encounter an error indicating that "runtime: linux/amd64 must be bootstrapped using make.bat." This error essentially means that the necessary tools for cross-compilation have not yet been built.
To resolve this issue, follow these steps:
For Windows GOARCH amd64:
Run the following batch commands:
set GOARCH=amd64 set GOOS=linux go tool dist install -v pkg/runtime go install -v -a std
For Windows GOARCH 386:
Once the appropriate tools have been built, you should be able to successfully execute the "go build" command and cross-compile your Go program for Linux.
The above is the detailed content of How to Fix the 'runtime: linux/amd64 must be bootstrapped' Error During Go Cross-Compilation from Windows?. For more information, please follow other related articles on the PHP Chinese website!