pebbe / zmq4

A Go interface to ZeroMQ version 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can Windows cross-compile Linux executables?

sujunbo opened this issue · comments

commented

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\zmq4@v1.0.0\reactor.go:10:4: undefined: State
D:\WinfoGo\pkg\mod\github.com\pebbe\zmq4@v1.0.0\reactor.go:11:9: undefined: State

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

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