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 を追加すると、ワークスペースに見つからないファイルとして表示されます (点線の境界線のアイコンが付いた赤)。