猿问

Qt5 上的 Go 静态库:架构 x86_64 的未定义符号:

我在 Qt5 中使用 go build 静态库,我.pro通过以下方式将其添加到文件中:


LIBS += /Users/xxxx/Desktop/xxxxxx/framework/xxxx.a

当我编译时,它给了我这个错误:


Undefined symbols for architecture x86_64:

  "_SecCertificateCopyNormalizedIssuerContent", referenced from:

      _isRootCertificate in xxxx.a(000021.o)

  "_SecCertificateCopyNormalizedSubjectContent", referenced from:

      _isRootCertificate in xxxx.a(000021.o)

  "_SecCertificateCopyShortDescription", referenced from:

      _CopyPEMRoots in xxxx.a(000021.o)

  "_SecItemExport", referenced from:

      _CopyPEMRoots in xxxx.a(000021.o)

  "_SecPolicyCopyProperties", referenced from:

      _isSSLPolicy in xxxx.a(000021.o)

  "_SecTrustSettingsCopyCertificates", referenced from:

      _CopyPEMRoots in xxxx.a(000021.o)

  "_SecTrustSettingsCopyTrustSettings", referenced from:

      _sslTrustSettingsResult in xxxx.a(000021.o)

  "_kSecPolicyAppleSSL", referenced from:

      _isSSLPolicy in xxxx.a(000021.o)

  "_kSecPolicyOid", referenced from:

      _isSSLPolicy in xxxx.a(000021.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [xxxx.app/Contents/MacOS/xxxx] Error 1

09:27:27: The process "/usr/bin/make" exited with code 2.

Error while building/deploying project xxxx (kit: Desktop Qt 5.13.1 clang 64bit)

When executing step "Make"

它出什么问题了?如何解决这个问题呢?
我已经尝试过clean并运行qmake。然而它没有用。
我也尝试重新编译静态库,不幸的是,它也不起作用。

慕勒3428872
浏览 122回答 1
1回答

蝴蝶刀刀

上面提到的所有符号都在Apple的Security框架中。我通过在我的文件中添加以下代码片段解决了这个问题.pro。macx {     LIBS += -framework Security }清理所有,运行 qmake 并运行它。现在错误应该消失了。
随时随地看视频慕课网APP

相关分类

Go
我要回答