dragonsun00000 2015-07-29 16:39
浏览 38
已采纳

前往:构建时如何显式链接到OS X框架?

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!

  • 写回答

1条回答 默认 最新

  • doushi1912 2015-07-29 19:21
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?