英文:
Go: How to explicitly link to OS X frameworks when building?
问题
在尝试在OS X 10.10.3上使用go get bitbucket.org/liamstask/goose/cmd/goose
获取和构建goose时,我遇到了以下错误:
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
我认为这个错误是由于OS X中的Security框架未链接导致的。可能与此相关的一些信息可以在这里找到:https://github.com/golang/go/issues/11258
那么,我该如何显式链接到这个库呢?或者还有其他我忽略的东西吗?
感谢帮助!
英文:
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
得分: 2
你可以将go build
的标志传递给go get
。所以:
go get -f -u -ldflags "-framework Security" bitbucket.org/liamstask/goose/cmd/goose
将强制下载并链接到Security框架。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论