0

我尝试在我的项目中使用 MailCore,但出现以下错误:

Undefined symbols for architecture armv7:
  "_MailCoreEnableLogging", referenced from:
      -[ImapSync run] in ImapSync.o
  "_OBJC_CLASS_$_CTCoreMessage", referenced from:
      l_OBJC_$_CATEGORY_CTCoreMessage_$_CTCoreMessageBuisnessMail in CTCoreMessage+BuisnessMail.o
  "_OBJC_IVAR_$_CTCoreMessage.myFields", referenced from:
      -[CTCoreMessage(CTCoreMessageBuisnessMail) libetpanDateTime] in CTCoreMessage+BuisnessMail.o
      -[CTCoreMessage(CTCoreMessageBuisnessMail) senderDate] in CTCoreMessage+BuisnessMail.o
  "_OBJC_CLASS_$_CTCoreAccount", referenced from:
      objc-class-ref in AttachmentDownloader.o
      objc-class-ref in ImapSync.o
  "_MailCoreDisableLogging", referenced from:
      -[ImapSync run] in ImapSync.o
  "_IfTrue_RaiseException", referenced from:
      -[ImapFolderWorker fetchFrom:to:seqDelta:syncingNew:progressOffset:progressTotal:alreadySynced:] in ImapFolderWorker.o
ld: symbol(s) not found for architecture armv7

但是所有这些方法都在那里,我可以在 MailCoreProject 中看到它们!

我希望有一个人可以帮助我!

4

2 回答 2

0

这些可能是很多事情。您如何将 MailCore 添加到您的项目中?作为静态库?

您缺少 armv7 架构的编译文件。确保它已添加到 MailCore 项目的“构建设置”中,然后尝试构建它。您可能为模拟器构建了 MailCore,现在您正尝试在设备上运行它。这些必须分开。

此外,您必须确保 MailCore 正在使用的所有库(例如 libetpan)都已正确编译。

PS:将 MailCore 添加到您的项目不是一个简单的过程,但它是值得的。:)

于 2012-02-24T14:02:58.883 回答
0

首先,我会检查您是否已将 libMailCore-ios.a 添加到“链接框架和库”列表中。

如果是这样,那么问题可能是 MailCore 项目是为一台设备编译的,而您的主项目是为另一台设备编译的。例如,

  • MailCore 项目是为模拟器编译的……MailCore 的符号是为 x86 架构生成的
  • 你的主项目是为真正的 iOS 设备编译的......所以链接器正在寻找 armv7 架构的 MailCore 符号
  • 因此,链接器抱怨,未找到 armv7 架构的符号

要解决此问题,请使用与主项目相同的设备(或相同的模拟器)重建 MailCore 子项目(build-clean 和 build)。

于 2013-11-04T18:59:33.517 回答