zmq4 icon indicating copy to clipboard operation
zmq4 copied to clipboard

Can Windows cross-compile Linux executables?

Open sujunbo opened this issue 5 years ago • 2 comments

D:\WinfoGo\src\MSA_GD\example\pub>SET GOOS=linux D:\WinfoGo\src\MSA_GD\example\pub>go build -o zmqPubServer pub.go

github.com/pebbe/zmq4

D:\WinfoGo\pkg\mod\github.com\pebbe\[email protected]\reactor.go:10:4: undefined: State D:\WinfoGo\pkg\mod\github.com\pebbe\[email protected]\reactor.go:11:9: undefined: State

sujunbo avatar Oct 17 '19 01:10 sujunbo

I'm having the same error when i try to statically link the library using:

GOOS=linux CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' ./cmd/myproject

jzandbergen avatar Feb 07 '20 12:02 jzandbergen

I believe this is due to dependency on the C libzmq library. You could try rebuilding with CGO_ENABLED=1

tdpu avatar Dec 03 '20 23:12 tdpu