Anton
Anton

Reputation: 6033

Go: How to explicitly link to OS X frameworks when building?

When trying to get and build goose on OS X 10.10.3 using go get bitbucket.org/liamstask/goose/cmd/goose I get this error:

Undefined symbols for architecture x86_64:
"_SecKeychainItemExport", referenced from:
  _FetchPEMRoots in 000001.o
"_SecTrustCopyAnchorCertificates", referenced from:
  _FetchPEMRoots in 000001.o
ld: symbol(s) not found for architecture x86_64

I figure this error being due to the Security framework in OS X not being linked. Some possibly related info here: https://github.com/golang/go/issues/11258

So, how can I link to this library explicitly? Or is there something else I am missing?

Thankful for help!

Upvotes: 1

Views: 633

Answers (1)

Alvivi
Alvivi

Reputation: 3331

You can pass go build flags to go get. So:

go get -f -u -ldflags "-framework Security" bitbucket.org/liamstask/goose/cmd/goose

will force the download and link against Security framework.

Upvotes: 2

Related Questions