andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

build error #355

Open bigsui opened 5 years ago

bigsui commented 5 years ago

main.go:5:2: build constraints exclude all Go files in /Users/suibingyue/develop/gowork/src/gotagtool/vendor/github.com/andlabs/ui

my env: gotagtool git:(master) ✗ go env GOARCH="amd64" GOBIN="/Users/suibingyue/develop/gopath/bin:/Users/suibingyue/develop/gowork/bin" GOCACHE="/Users/suibingyue/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin"

andlabs commented 5 years ago

Is there a way you can get more verbose information on what these "constraints" are? Because I don't know what they are.

ghost commented 4 years ago

Hi!

I'm trying to build a cross compiler Docker container on Linux (the one in the docs is old and only has go1.10) and I'm getting a similar error:

GOARCH=amd64 GOOS=darwin CGO_LDFLAGS_ALLOW="-mmacosx-version-min.*" CC=o64-clang CXX=o64-clang++ go build -o macapp
main.go:8:2: build constraints exclude all Go files in /go/src/github.com/andlabs/ui

When I get this running, I'll submit a PR so that you can include the container Dockerfile in the repo if that's okay with you.

andlabs commented 4 years ago

@darkermatter You may need CGO_ENABLED=1.

ghost commented 4 years ago

@andlabs Thanks! I eventually figured that out, now I'm getting another error:

GOARCH=amd64 GOOS=darwin CGO_LDFLAGS_ALLOW="-mmacosx-version-min.*" CC=o64-clang CXX=o64-clang++ go build -o macapp
# runtime/cgo
/usr/local/osx-ndk-x86/bin/x86_64-apple-darwin15-ld: error while loading shared libraries: libxar.so.1: cannot open shared object file: No such file or directory
clang-9: error: unable to execute command: No such file or directory
clang-9: error: linker command failed due to signal (use -v to see invocation)

I imagine that it has something to do with library paths but I'm clueless about cgo