I am using go1.8 arm/ darwin not work , for both bin and archive .how to solve that
GOOS=darwin GOARCH=arm GOARM=7 go build -buildmode=c-archive -o libmug.a > can't load package: package .: no buildable Go source files in .... > > GOOS=darwin GOARCH=arm go build -v -o hello.ios main.go > runtime/internal/sys > runtime/internal/atomic > runtime > math > command-line-arguments > # command-line-arguments > warning: unable to find runtime/cgo.a > /usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64/link: running > clang failed: exit status 1 > ld: warning: ignoring file > /var/folders/cp/561_gl9j1wzd8dgv_fn5mk7c0000gn/T/go-link-691505992/go.o, > file was built for armv7 which is not the architecture being linked > (x86_64): > /var/folders/cp/561_gl9j1wzd8dgv_fn5mk7c0000gn/T/go-link-691505992/go.o > Undefined symbols for architecture x86_64: > "_main", referenced from: > implicit entry/start for main executable > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) 在 2015年6月3日星期三 UTC+8下午8:34:38,Sarim Khan写道: > > Hello, > > go version go1.4 darwin/amd64 > > I'm trying to create a static library written in golang, then using that > static library in a c/obj/xcode project. > > == gittu.go == > > package gittu > > import "C" > > //export getGittu > func getGittu() *C.char { > s := "Hello Gittu" > return C.CString(s) > } > > == > > After that i use "go install" to generate a gittu.a in > $GOPATH/pkg/darwin_amd64/.............. > > But when i include that gittu.a in xcode, i get this error, > > ignoring file /usr/local/Cellar/go/1.4/packages/pkg/darwin_amd64/ > github.com/sarim/gittu.a, file was built for archive which is not the > architecture being linked (x86_64) > > I manually tried to run cc, but still the same error. Any idea how to > generate x86_64 static lib? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.