minus5/gofreetds

Cross compilation failed?

Closed this issue · 4 comments

VSCode mac -> windows

➜  Sendsms CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
# github.com/minus5/gofreetds
../../../../go/pkg/mod/github.com/minus5/gofreetds@v0.0.0-20190219163700-c92a62efdcd5/conn_pool.go:33:19: undefined: Conn
../../../../go/pkg/mod/github.com/minus5/gofreetds@v0.0.0-20190219163700-c92a62efdcd5/params_cache.go:8:22: undefined: spParam
ianic commented

We are depending here on freetds package. Which is C library, so we can't build project with cgo disabled.
That probably makes cross compiling impossible or at least much harder.

Can I compile on a Windows system?

ianic commented

Newer tried. But I don't know of any show stopper.
Both Go and freetds are available on that platform.

@hjzCy I get this error when I tried to build with cross compile options. I can build and run on mac but when I add the cross compile options I get this error.