哈巴狗框架

Pugpig framework

我有一个带有 Pugpig 框架的应用程序和这个错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_KGLocalFileDataSource", referenced from:
      objc-class-ref in SolitairViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我的架构是armv7 arm64。

如果我删除 arm64 它可以工作,但是当我在 itunes connect 上提交应用程序时它是无效的二进制文件。

我试图改变我的 pugpig 框架,我明白了:

O

BJC_CLASS_$_SLComposeViewController", referenced from:
      objc-class-ref in Pugpig
  "_SLServiceTypeFacebook", referenced from:
      -[KGFacebookSharingImplementation shareFromViewController:completionHandler:] in Pugpig
  "_SLServiceTypeTwitter", referenced from:
      -[KGTwitterSharingImplementation shareFromViewController:completionHandler:] in Pugpig
  "_UTTypeCopyPreferredTagWithClass", referenced from:
      -[KGDocumentCache unzipURL:forDocument:] in Pugpig
  "_UTTypeCreatePreferredIdentifierForTag", referenced from:
      -[KGDocumentCache unzipURL:forDocument:] in Pugpig
  "_crc32", referenced from:
      _unzReadCurrentFile in Pugpig
  "_htmlEntityLookup", referenced from:
      -[NSString(KGAdditions) stringByStrippingHTML] in Pugpig
  "_inflate", referenced from:
      _unzReadCurrentFile in Pugpig
  "_inflateEnd", referenced from:
      _unzCloseCurrentFile in Pugpig
  "_inflateInit2_", referenced from:
      _unzOpenCurrentFile3 in Pugpig
  "_kUTTagClassFilenameExtension", referenced from:
      -[KGDocumentCache unzipURL:forDocument:] in Pugpig
  "_kUTTagClassMIMEType", referenced from:
      -[KGDocumentCache unzipURL:forDocument:] in Pugpig
  "_xmlCopyNode", referenced from:
      -[KGOPFItem initWithPackage:node:query:] in Pugpig
      -[KGXMLDOMParser nodeFromQuery:onNode:] in Pugpig
  "_xmlFree", referenced from:
      -[KGAtomEntry attributesForNodeFromQuery:] in Pugpig
      -[KGXMLDOMParser stringFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser stringsFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser dictionaryFromQuery:keyFromAttribute:] in Pugpig
  "_xmlFreeDoc", referenced from:
      -[KGXMLDOMParser dealloc] in Pugpig
  "_xmlFreeNode", referenced from:
      -[KGOPFItem dealloc] in Pugpig
  "_xmlNodeGetContent", referenced from:
      -[KGXMLDOMParser stringFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser stringsFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser dictionaryFromQuery:keyFromAttribute:] in Pugpig
  "_xmlNodeListGetString", referenced from:
      -[KGAtomEntry attributesForNodeFromQuery:] in Pugpig
  "_xmlReadMemory", referenced from:
      -[KGXMLDOMParser initWithData:] in Pugpig
  "_xmlStrcmp", referenced from:
      -[KGAtomEntry deletedEntry] in Pugpig
  "_xmlXPathEvalExpression", referenced from:
      -[KGXMLDOMParser stringFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser nodesFromQuery:onNode:] in Pugpig
      -[KGXMLDOMParser nodeFromQuery:onNode:] in Pugpig
  "_xmlXPathFreeContext", referenced from:
      -[KGXMLDOMParser dealloc] in Pugpig
  "_xmlXPathFreeObject", referenced from:
      -[KGPugpigPackageDocumentType document:didFinishDownloadingSourceURL:withResponse:userInfo:] in Pugpig
      -[KGAtomFeed dealloc] in Pugpig
      -[KGOPFPackage dealloc] in Pugpig
      -[KGAtomEntry categoriesWithScheme:] in Pugpig
      -[KGAtomEntry attributesForNodeFromQuery:] in Pugpig
      -[KGNCXFile initWithContentsOfURL:] in Pugpig
      -[KGXMLDOMParser stringFromQuery:onNode:] in Pugpig
      ...
  "_xmlXPathNewContext", referenced from:
      -[KGXMLDOMParser initWithData:] in Pugpig
  "_xmlXPathRegisterNs", referenced from:
      -[KGXMLDOMParser registerNamespacePrefix:forURL:] in Pugpig
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

听起来您需要更新版本的 Pugpig.framework。 2.4 及以上版本支持 64 位,https://pugpig.zendesk.com/hc/en-us/articles/202429446-Release-Notes#2.4.0


在回答您修改后的问题时,链接器错误是由缺少依赖项引起的。在第一种情况下,它与您没有带有 64 位切片的 Pugpig 版本有关,在后一种情况下,它与目标构建设置中缺少 frameworks/libraries 有关。具体在您的情况下,您需要添加

-lz -lxml2 -weak_framework Twitter -weak_framework Social

到 "Other Linker Flags" 下目标的构建设置。

如果您搜索缺失的符号,您通常会找到每个符号的现有答案。例如参见 [​​=15=].