I run this command to cross compile from window to linux but it doesn't work.
go version go1.17 windows/amd64
$ env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=zig cc -target x86_64-linuxCXX=zig c++ -target x86_64-linux` go build
output :
zig: error: no input files
zig: error: no input files
I run this command to cross compile from window to linux but it doesn't work.
go version go1.17 windows/amd64
$ env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=
zig cc -target x86_64-linux
CXX=
zig c++ -target x86_64-linux
` go buildoutput :
zig: error: no input files
zig: error: no input files
Turns out the required patch did not land in Go 1.17 so you will have to use the workaround still, sorry! I've updated the article.