Closed anacrolix closed 3 years ago
I had the same error.
You can do something like:
sudo apt-get install mingw-w64
CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build .
Maybe just the CGO_ENABLED=1
is enough.
Thanks @cugu. CGO_ENABLED
was necessary to get the package to try to build the stuff it was missing. On Ubuntu, apt install gcc-multilib
installed the necessary stuff to build for 32-bit.
# apt install gcc-multilib
# CGO_ENABLED=1 GOARCH=386 go build ./...
Note I am doing this from linux/amd64, and the fork doesn't change anything that would affect this build:
I'm not sure if this is due to a cgo shortcoming for cross-compiling or something else.