Xcode无法找到XMPPFramework - 您如何解决链接器错误?

问题描述:

这一定是一个普遍的问题,但我会很感激任何帮助。我有一个Xcode 4.2项目,它不会没有错误地构建。问题是iOS的XMPPFramework。我已经按照维基上的指示。Xcode无法找到XMPPFramework - 您如何解决链接器错误?

我不是很深入地了解发生了什么,但Xcode无法找到我的XMPPFramework(iOS版)。这是错误,我不知道如何解决它。我在项目和目标设置中添加了XMPPFramework的路径。我的XMPPFramework文件位于我的Xcode项目的根目录,但Xcode似乎无法找到这些文件。什么是用户头文件路径,框架路径和库搜索路径?我已经将XMPPFramework的路径添加到所有这些字段中,没有任何好处。我用$(继承)和$(SRCROOT)并检查了递归按钮。我所有的观点都可以帮助我解决这个问题。

Undefined symbols for architecture i386:
"_ExtractFileNameWithoutExtension", referenced from: -[AppDelegate_iPhone contextDidSave:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStreamDidSecure:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStreamDidConnect:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStreamDidAuthenticate:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStream:didNotAuthenticate:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStream:didReceiveIQ:] in AppDelegate_iPhone.o -[AppDelegate_iPhone xmppStream:didReceiveMessage:] in AppDelegate_iPhone.o ... "_OBJC_CLASS_$_DDLog", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_DDTTYLogger", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPStream", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPReconnect", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPRosterCoreDataStorage", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPRoster", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardCoreDataStorage", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardTempModule", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardAvatarModule", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPCapabilitiesCoreDataStorage", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPCapabilities", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPPresence", referenced from: objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPJID", referenced from: objc-class-ref in AppDelegate_iPhone.o objc-class-ref in AccountViewController.o objc-class-ref in AddBuddyViewController.o objc-class-ref in ChatViewController.o objc-class-ref in GroupChatViewController.o ld: symbol(s) not found for architecture i386

铛:错误:连接器命令,退出代码1(使用-v看调用)

没关系失败,计算出来。您不能将文件拖放到项目中。您必须将它们复制到项目文件夹中,然后添加它们。

+1

男人,这太令人讨厌了。谢谢你的提示! – 2012-04-16 16:26:36

作为附加组件,我想说,如果您使用的是Xcode 4.6.1或更高版本,那么将文件复制到项目文件夹并将它们拖放到Xcode的例程也无法解决此问题链接器错误。

这里的解决方法是在Xcode项目(右键单击 - >新建组)中自己创建“组”,然后通过拖放它们将相应的文件/文件夹添加到这些组中。确保不要选中“将文件复制到源文件夹”选项。但是,请务必检查“添加到目标”选项。要了解要创建的组,可以查看他们的示例XMPP项目。在相同的层次结构中创建它们,如该项目中所示。

还要确保您已将CoreData.framework和SystemConfiguration.framework包含到框架中。

如果以某种方式,你仍然无法正常工作,我建议你看看你从他们的Git链接下载的XMPPFramework主副本中包含的示例XMPP项目。检查他们如何安排文件分组以及他们项目的文件夹结构。只要按照套件,你应该很好。