sciter-sdk / go-sciter

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
https://sciter.com
2.58k stars 268 forks source link

Go Cross-Compile build windows exe on mac : cannot find module for path github.com/lxn/win #305

Closed gitgitcode closed 3 years ago

gitgitcode commented 3 years ago

version of Go

go version go1.13.7 darwin/amd64

go env

GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Library/Caches/go-build" GOENV="/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Golan/goWorkSpace" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/usr/local/opt/go/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/fnfig/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w5/x6zbdtkn3tggr0q54dl31j840000gn/T/go-build959481107=/tmp/go-build -gno-record-gcc-switches -fno-common"

Cross-Compile build windows exe on mac

module fnfig

go 1.13

require (
    github.com/go-sql-driver/mysql v1.6.0
    github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
    github.com/sciter-sdk/go-sciter v0.5.0
    golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
)

if build other file not require github.com/lxn/win its successful

so how to build to be successful ? or where can i get some log