使用XMPPFrameworke遇到的問題

將XMPPFrameworke所有文件導入進自己的項目中後遇到了幾個問題,
1,出現libxml/tree.h file not found,這個只需要在target———》Build Rules———》Link Binary With Libraries導入 libxml2.dylib 包,然後在target———》Build Setting裏面設置Header Search Paths爲 /usr/include/libxml2這裏寫圖片描述
這個問題就解決了。但是又出現了新的錯誤,而且非常多:

Undefined symbols for architecture i386:
      "_initGenericErrorDefaultFunc", referenced from:
          ___23+[DDXMLNode initialize]_block_invoke in DDXMLNode.o
      "_xmlAddChild", referenced from:
          -[DDXMLElement addAttribute:] in DDXMLElement.o
          -[DDXMLElement addChild:] in DDXMLElement.o
          -[DDXMLElement insertChild:atIndex:] in DDXMLElement.o
          _xmpp_xmlStartElement in XMPPParser.o
          _xmpp_xmlCharacters in XMPPParser.o
      "_xmlAddPrevSibling", referenced from:
          -[DDXMLElement insertChild:atIndex:] in DDXMLElement.o
      "_xmlBufferCreate", referenced from:
          -[DDXMLNode XMLStringWithOptions:] in DDXMLNode.o
      "_xmlBufferFree", referenced from:
          -[DDXMLNode XMLStringWithOptions:] in DDXMLNode.o
      "_xmlCopyDoc", referenced from:
          -[DDXMLNode copyWithZone:] in DDXMLNode.o
      "_xmlCopyDtd", referenced from:
          -[DDXMLNode copyWithZone:] in DDXMLNode.o
      "_xmlCopyNamespace", referenced from:
          -[DDXMLNode copyWithZone:] in DDXMLNode.o
      "_xmlCopyNode", referenced from:
          _xmpp_onDidReadRoot in XMPPParser.o
          -[DDXMLNode copyWithZone:] in DDXMLNode.o
      "_xmlCopyProp", referenced from:
          -[DDXMLNode copyWithZone:] in DDXMLNode.o
      "_xmlCreatePushParserCtxt", referenced from:
          -[XMPPParser initWithDelegate:delegateQueue:parserQueue:] in XMPPParser.o
      "_xmlCtxtGetLastError", referenced from:
          ___24-[XMPPParser parseData:]_block_invoke in XMPPParser.o
      "_xmlDocGetRootElement", referenced from:
          -[DDXMLDocument rootElement] in DDXMLDocument.o
          _xmpp_postEndElement in XMPPParser.o
          _xmpp_xmlSearchNs in XMPPParser.o
          _xmpp_postStartElement in XMPPParser.o
      "_xmlDocSetRootElement", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlEncodeSpecialChars", referenced from:
          -[DDXMLNode setStringValue:] in DDXMLNode.o
          -[DDXMLNamespaceNode setStringValue:] in DDXMLNode.o
          -[DDXMLAttributeNode setStringValue:] in DDXMLNode.o
      "_xmlFree", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
          -[DDXMLNode setStringValue:] in DDXMLNode.o
          -[DDXMLNode stringValue] in DDXMLNode.o
          -[DDXMLNamespaceNode setName:] in DDXMLNode.o
          -[DDXMLNamespaceNode setStringValue:] in DDXMLNode.o
          -[DDXMLAttributeNode setStringValue:] in DDXMLNode.o
          _xmpp_xmlStartElement in XMPPParser.o
          -[DDXMLNode setStringValue:] in DDXMLNode.o
          -[DDXMLNode stringValue] in DDXMLNode.o
          -[DDXMLNamespaceNode setName:] in DDXMLNode.o
          -[DDXMLNamespaceNode setStringValue:] in DDXMLNode.o
          -[DDXMLAttributeNode setStringValue:] in DDXMLNode.o
      "_xmlFreeDoc", referenced from:
          -[XMPPParser dealloc] in XMPPParser.o
          -[DDXMLNode dealloc] in DDXMLNode.o
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlFreeDtd", referenced from:
          -[DDXMLNode dealloc] in DDXMLNode.o
      "_xmlFreeNode", referenced from:
          -[DDXMLNode dealloc] in DDXMLNode.o
          +[DDXMLNode removeChild:] in DDXMLNode.o
          +[DDXMLNode removeAllChildrenFromNode:] in DDXMLNode.o
      "_xmlFreeNs", referenced from:
          -[DDXMLNode dealloc] in DDXMLNode.o
          +[DDXMLNode removeNamespace:fromNode:] in DDXMLNode.o
          +[DDXMLNode removeAllNamespacesFromNode:] in DDXMLNode.o
          -[DDXMLAttributeNode dealloc] in DDXMLNode.o
          -[DDXMLAttributeNode setURI:] in DDXMLNode.o
      "_xmlFreeParserCtxt", referenced from:
          -[XMPPParser dealloc] in XMPPParser.o
      "_xmlFreeProp", referenced from:
          -[DDXMLNode dealloc] in DDXMLNode.o
          +[DDXMLNode removeAttribute:] in DDXMLNode.o
          +[DDXMLNode removeAllAttributesFromNode:] in DDXMLNode.o
      "_xmlIndentTreeOutput", referenced from:
          -[DDXMLNode XMLStringWithOptions:] in DDXMLNode.o
      "_xmlKeepBlanksDefault", referenced from:
          -[DDXMLDocument initWithData:options:error:] in DDXMLDocument.o
          ___23+[DDXMLNode initialize]_block_invoke in DDXMLNode.o
      "_xmlNewComment", referenced from:
          +[DDXMLNode commentWithStringValue:] in DDXMLNode.o
      "_xmlNewDoc", referenced from:
          -[XMPPParser initWithDelegate:delegateQueue:parserQueue:] in XMPPParser.o
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlNewDocNode", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
      "_xmlNewNode", referenced from:
          -[DDXMLElement initWithName:] in DDXMLElement.o
          -[DDXMLElement initWithName:URI:] in DDXMLElement.o
          -[DDXMLElement initWithName:stringValue:] in DDXMLElement.o
      "_xmlNewNs", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
          +[DDXMLNode namespaceWithName:stringValue:] in DDXMLNode.o
          -[DDXMLNode setURI:] in DDXMLNode.o
          +[DDXMLNode recursiveMigrateNamespace:to:node:] in DDXMLNode.o
          +[DDXMLNode recursiveFixDefaultNamespacesInNode:withNewRoot:] in DDXMLNode.o
          -[DDXMLAttributeNode detach] in DDXMLNode.o
          -[DDXMLAttributeNode setURI:] in DDXMLNode.o
          ...
      "_xmlNewNsProp", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
      "_xmlNewPI", referenced from:
          +[DDXMLNode processingInstructionWithName:stringValue:] in DDXMLNode.o
      "_xmlNewProp", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
          +[DDXMLNode attributeWithName:stringValue:] in DDXMLNode.o
          +[DDXMLNode attributeWithName:URI:stringValue:] in DDXMLNode.o
      "_xmlNewText", referenced from:
          +[DDXMLNode textWithStringValue:] in DDXMLNode.o
          -[DDXMLAttributeNode setStringValue:] in DDXMLNode.o
      "_xmlNewTextLen", referenced from:
          _xmpp_xmlCharacters in XMPPParser.o
      "_xmlNodeDump", referenced from:
          -[DDXMLNode XMLStringWithOptions:] in DDXMLNode.o
      "_xmlNodeGetContent", referenced from:
          -[DDXMLNode stringValue] in DDXMLNode.o
      "_xmlNodeSetContent", referenced from:
          -[DDXMLNode setStringValue:] in DDXMLNode.o
          -[DDXMLAttributeNode setStringValue:] in DDXMLNode.o
      "_xmlNodeSetName", referenced from:
          -[DDXMLNode setName:] in DDXMLNode.o
      "_xmlParseChunk", referenced from:
          ___24-[XMPPParser parseData:]_block_invoke in XMPPParser.o
      "_xmlParseMemory", referenced from:
          -[DDXMLDocument initWithData:options:error:] in DDXMLDocument.o
      "_xmlSaveNoEmptyTags", referenced from:
          -[DDXMLNode XMLStringWithOptions:] in DDXMLNode.o
      "_xmlSearchNs", referenced from:
          -[DDXMLElement elementsForName:] in DDXMLElement.o
          -[DDXMLAttributeNode URI] in DDXMLNode.o
      "_xmlSetStructuredErrorFunc", referenced from:
          ___23+[DDXMLNode initialize]_block_invoke in DDXMLNode.o
      "_xmlStopParser", referenced from:
          _xmpp_xmlAbortDueToMemoryShortage in XMPPParser.o
      "_xmlStrEqual", referenced from:
          -[DDXMLElement _elementsForName:localName:prefix:uri:] in DDXMLElement.o
          -[DDXMLElement _hasAttributeWithName:] in DDXMLElement.o
          -[DDXMLElement _removeAttributeForName:] in DDXMLElement.o
          -[DDXMLElement attributeForName:] in DDXMLElement.o
          -[DDXMLElement _removeNamespaceForPrefix:] in DDXMLElement.o
          -[DDXMLElement namespaceForPrefix:] in DDXMLElement.o
          -[DDXMLElement _recursiveResolveNamespaceForPrefix:atNode:] in DDXMLElement.o
          ...
      "_xmlStrQEqual", referenced from:
          -[DDXMLElement attributeForName:] in DDXMLElement.o
      "_xmlStrdup", referenced from:
          -[DDXMLNamespaceNode setName:] in DDXMLNode.o
      "_xmlStringLenDecodeEntities", referenced from:
          _xmpp_xmlStartElement in XMPPParser.o
      "_xmlUnlinkNode", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlXPathEvalExpression", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlXPathFreeContext", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlXPathFreeObject", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlXPathNewContext", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
      "_xmlXPathRegisterNs", referenced from:
          -[DDXMLNode nodesForXPath:error:] in DDXMLNode.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invo

cation)


----------

原來是缺少一個依賴庫,添加這個庫 libresolv就可以解決了

發佈了33 篇原創文章 · 獲贊 5 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章