4

Cocoa SoundCloud APIを iPhone/iPad アプリに統合しようとしています。ここで説明されている手順に従いましたが、プロジェクトをビルドして実行しようとすると、次のエラーが発生します。

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

私はiPhoneの開発にまったく慣れていないため、修正方法がわかりません。フレームワークが不足していると思いますが、ステップ 3 で述べたようにフレームワークを追加しました。

  • ここで、ターゲットは、リンクする必要がある新しいライブラリについて知る必要があります。そのため、プロジェクトでターゲットを選択し、ビルド フェーズで [バイナリをライブラリにリンク] セクションに移動します。以下を追加します。

    • libSoundCloudAPI.a (またはデスクトップの SoundCloudAPI.framework)
    • libOAuth2Client.a (またはデスクトップの OAuth2Client.framework)
    • Security.framework
    • AudioToolbox.framework (ストリーミングが必要な場合)

ただし、libSoundCloudAPI.a と libOAuth2Client.a を追加すると、ワークスペースに見つからないファイルとして表示されます (点線の境界線のアイコンが付いた赤)。

4

1 に答える 1

1

iOS 開発に慣れていない場合、SoundCloud をアプリに統合する最良の方法は、新しいCocoaSoundCloudAPIを使用することです。あなたが参照しているものは、SoundCloud でサポートされなくなりました。

これをプロジェクトに統合するには、次のいくつかの手順が必要です。

ターミナルで

  1. プロジェクト ディレクトリに移動します。

  2. 必要な 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
    

Xcodeで

  1. 上記で追加したすべてのサブモジュールを含むワークスペースを作成します。

  2. ヘッダーを見つけることができるようにするには、メイン プロジェクトのに../**(または./**設定によっては)追加する必要があります。Header Search Path

  3. ここで、ターゲットは、リンクする必要がある新しいライブラリについて知る必要があります。ProjectでTargetを選択し、Build PhasesでLink Binary with Librariesセクションに移動します。以下を追加します。

    • 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. 次のステップは、リンカーが必要なものをすべて見つけられるようにすることです: プロジェクトのビルド設定に移動し、次を [その他のリンカー フラグ] に追加します。

    -all_load -ObjC
    
  5. iOS では、いくつかのグラフィックスが必要です。ディレクトリからリソースに移動してくださいSoundCloud.bundleCocoaSoundCloudUI/

于 2012-03-22T10:11:56.550 に答える