2014-05-25 9 views
5

Ho ricevuto questo errore durante la compilazione del mio progetto esistente su XCode. Provo a utilizzare il quickstart da Google Drive (Passaggio 3) https://developers.google.com/drive/ios/quickstart e dopo aver completato tutti gli 8 passaggi, ho ricevuto 4 errori di errore del linker Apple Mach-O. Poi ho annullato tutti i passaggi, ma anche peggio.Errore linker Apple Mach-O - Obiettivo C

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) 

Please help me, sono stato bloccato per più di 4 giorni :(

risposta

16

è necessario collegare libxml2. In Xcode, aggiungere

OTHER_LDFLAGS = -lxml2 
HEADER_SEARCH_PATHS = /usr/include/libxml2 

Xcode configuration

Altro dettagli here

+0

Grazie, mi ha davvero aiutato. Avevo un framework che stava manipolando XML e non richiedeva che questa libreria fosse definita in modo specifico nei flag del linker, ma l'app che usava il framework ne aveva bisogno. – jackofallcode