DEV Community

Discussion on: Zig Makes Go Cross Compilation Just Work

Collapse
 
fufuu profile image
fufuu • Edited

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

Collapse
 
kristoff profile image
Loris Cro • Edited

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.