【问题标题】:Compile error with UrbanAirpush about some files missing关于缺少某些文件的 UrbanAirpush 编译错误
【发布时间】:2013-03-27 23:58:31
【问题描述】:

编译代码时出现此错误:

Ld /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator/BusinessIdea.app/BusinessIdea normal i386
    cd /Users/owner12/Desktop/BusinessIdea
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator -L/Users/owner12/Desktop/BusinessIdea/BusinessIdea/Airship -F/Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator -filelist /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Intermediates/BusinessIdea.build/Debug-iphonesimulator/BusinessIdea.build/Objects-normal/i386/BusinessIdea.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework UIKit -framework Foundation -framework CoreGraphics -lUAirship-1.4.0 -lUAirshipFull-1.4.0 -o /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator/BusinessIdea.app/BusinessIdea

Undefined symbols for architecture i386:
  "_AudioServicesCreateSystemSoundID", referenced from:
      -[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
      -[UAPushSettingsSoundsViewController tableView:didSelectRowAtIndexPath:] in UAPushSettingsSoundsViewController.o
  "_AudioServicesPlayAlertSound", referenced from:
      -[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
      -[UAPushSettingsSoundsViewController tableView:didSelectRowAtIndexPath:] in UAPushSettingsSoundsViewController.o
  "_AudioServicesPlaySystemSound", referenced from:
      -[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
  "_CFHTTPAuthenticationCopyMethod", referenced from:
      -[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
      -[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
  "_CFHTTPAuthenticationCopyRealm", referenced from:
      -[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
      -[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
  "_CFHTTPAuthenticationCreateFromResponse", referenced from:
      -[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
      -[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)

它们非常神秘,在谷歌上搜索整个错误并没有带来太多。有谁知道为什么会发生这种情况以及如何解决这个问题?

谢谢!

【问题讨论】:

    标签: ios objective-c ios5 urbanairship.com


    【解决方案1】:

    您必须将以下框架添加到您的项目中。 AudioServices、CFNetwork、SystemConfiguration、MobileCoreServices、zlib 和 libxml2。对于 libxml2 和 zlib,您必须在构建设置中向 Header Search Paths 添加 2 个条目。 /usr/include//usr/include/libxml2/

    要添加它们(它们已包含在 Xcode 中),请执行此操作

    单击加号按钮,并添加我上面列出的所有框架。 (Cocoa.framework 不是必需的,这只是来自我的项目)。如果您向下滚动,它位于您的项目摘要中。

    【讨论】:

    • 谢谢!我有点困惑为什么我必须添加这些。我正在从另一个示例中工作,该应用程序没有这些库....我有点困惑。
    • UrbanAirpush 需要它们,因为它们包含诸如 AudioServicesCreateSystemSoundID 之类的方法,这些方法是项目编译所必需的。您的其他项目可能没有这些,因为它们不使用这些框架中的方法。
    • 你知道我应该从哪里下载这些框架吗?我认为它应该与 UrbanAirship 库一起提供,不是吗?
    • 您不必下载它们,因为它们已经在 Xcode 中了。检查我的编辑。
    • 嗯,似乎找不到它。它是否在目标-> 构建阶段下?还是别的地方?
    猜你喜欢
    • 2013-10-01
    • 2013-08-11
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 2014-10-12
    • 1970-01-01
    • 2019-11-21
    相关资源
    最近更新 更多