代码之家  ›  专栏  ›  技术社区  ›  Genadinik

UrbanAirpush关于某些文件丢失的编译错误

  •  0
  • Genadinik  · 技术社区  · 11 年前

    编译代码时出现以下错误:

    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)
    

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

    谢谢

    1 回复  |  直到 11 年前
        1
  •  2
  •   Chris Loonam    11 年前

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

    要添加它们(它们已经包含在Xcode中),请执行以下操作 enter image description here

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