简体   繁体   English

SoundCloud API Apple Mach-O链接器(Id)错误

[英]SoundCloud API Apple Mach-O Linker (Id) Error

I'm trying to integrate the Cocoa SoundCloud API into my iPhone/iPad app. 我正在尝试将Cocoa SoundCloud API集成到我的iPhone / iPad应用程序中。 I've followed the instructions detailed here but when I try to Build and Run my project, I get the following error: 我按照这里详细说明进行操作但是当我尝试构建并运行我的项目时,出现以下错误:

Apple Mach-O Linker (Id) Error Apple Mach-O链接器(Id)错误

Ld "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp" normal i386
    cd "/Users/curuser/Dropbox/iPhone Apps/MyApp"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator -F/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator -filelist "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -all_load -ObjC -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -framework UIKit /Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/SoundCloudAPI/SoundCloudAPI -framework Security -framework OAuth2Client /Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/libSoundCloudAPI.a -lOAuth2Client -framework AudioToolbox -framework Foundation -o "/Users/curuser/Library/Developer/Xcode/DerivedData/MyApp-gzdzxolteaojcobbqsfkgxakkclz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp"

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

I'm quite new to iPhone development, and I can't figure out how to fix it. 我对iPhone开发很新,我无法弄清楚如何修复它。 My guess is that I'm missing a framework, but I've added the frameworks as stated in step #3: 我的猜测是我错过了一个框架,但我添加了步骤#3中所述的框架:

  • Now the Target needs to know about the new libraries it should link against. 现在,Target需要了解它应链接的新库。 So in the Project, select the Target, and in Build Phases go to the Link Binary with Libraries section. 因此,在项目中,选择Target,然后在Build Phases中转到Link Binary with Libraries部分。 Add the following: 添加以下内容:

    • libSoundCloudAPI.a (or SoundCloudAPI.framework on Desktop) libSoundCloudAPI.a(或桌面上的SoundCloudAPI.framework)
    • libOAuth2Client.a (or OAuth2Client.framework on Desktop) libOAuth2Client.a(或桌面上的OAuth2Client.framework)
    • Security.framework Security.framework
    • AudioToolbox.framework (if you want streaming) AudioToolbox.framework(如果你想要流媒体)

When I add libSoundCloudAPI.a and libOAuth2Client.a though, it shows up as a missing file from workspace (red with the dotted border icon). 当我添加libSoundCloudAPI.a和libOAuth2Client.a时,它会显示为工作区中的缺失文件(红色,带有虚线边框图标)。

If you are new to iOS development, the best way to integrate SoundCloud into you App is by using the new CocoaSoundCloudAPI . 如果您不熟悉 iOS开发,将SoundCloud集成到App中的最佳方法是使用新的CocoaSoundCloudAPI The one that you are referring to is not longer supported by SoundCloud. SoundCloud不再支持您所指的那个。

To integrate this into you project you just need these few steps: 要将其集成到您的项目中,您只需要以下几个步骤:

In the Terminal 在终端

  1. Go to your project directory. 转到您的项目目录。

  2. Add the required GIT Submodules 添加所需的GIT子模块

     // For the API git submodule add git://github.com/nxtbgthng/OAuth2Client.git git submodule add git://github.com/soundcloud/CocoaSoundCloudAPI.git git submodule add git://github.com/nxtbgthng/JSONKit.git git submodule add git://github.com/nxtbgthng/OHAttributedLabel.git git submodule add git://github.com/soundcloud/CocoaSoundCloudUI.git 

In Xcode 在Xcode中

  1. Create a Workspace containing all those submodules added above. 创建一个包含上面添加的所有子模块的工作区。

  2. To be able to find the Headers, you still need to add ../** (or ./** depending on your setup) to the Header Search Path of the main project. 为了能够找到标题,您仍然需要将../** (或./**具体取决于您的设置)添加到主项目的Header Search Path中。

  3. Now the Target needs to know about the new libraries it should link against. 现在,Target需要了解它应链接的新库。 So in the Project , select the Target , and in Build Phases go to the Link Binary with Libraries section. 因此,在项目中 ,选择Target ,然后在Build Phases中转到Link Binary with Libraries部分。 Add the following: 添加以下内容:

    • libSoundCloudAPI.a
    • libOAuth2Client.a
    • libJSONKit.a
    • libOHAttributedLabel.a
    • libSoundCloudUI.a
    • QuartzCore.framework
    • AddressBook.framework
    • AddressBookUI.framework
    • CoreLocation.framework
    • Security.framework
    • CoreGraphics.framework
    • CoreText.framework
  4. Next step is to make sure that the Linker finds everything it needs: So go to the Build settings of the project and add the following to Other Linker Flags 下一步是确保链接器找到它需要的所有内容:所以转到项目的Build设置并将以下内容添加到Other Linker Flags

     -all_load -ObjC 
  5. On iOS we need a few graphics: Please move the SoundCloud.bundle from the CocoaSoundCloudUI/ directory to your Resources. 在iOS上我们需要一些图形:请将SoundCloud.bundleCocoaSoundCloudUI/目录移动到您的资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM