SoundCloud API Apple Mach-O Linker (Id) Error

I am trying to integrate the Cocoa SoundCloud API into my iPhone / iPad app. I followed the instructions described in detail here , but when I try to create and run a project, I get the following error:

Apple Mach-O Linker Error (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 am new to iPhone development and I cannot figure out how to fix this. I assume that I am missing the framework, but I added the frameworks as indicated in step 3:

  • Target should now know about the new libraries that it should link to. So, in the project, select Target, and in the assembly phases, go to the "Linking binaries to libraries" section. Add the following:

    • libSoundCloudAPI.a (or SoundCloudAPI.framework on the desktop)
    • libOAuth2Client.a (or OAuth2Client.framework on the desktop)
    • Security.framework
    • AudioToolbox.framework (if you want streaming)

When I add libSoundCloudAPI.a and libOAuth2Client.a, although it appears as a missing file from the workspace (red with a dashed border symbol).

+4
source share
1 answer

If you are new to iOS development, the best way to integrate SoundCloud into your application is to use CocoaSoundCloudAPI . The sound you mean is no longer supported by SoundCloud.

To integrate this project into your project, you just need the following steps:

In terminal

  • Go to the project directory.

  • Add the necessary GIT submodules

     // 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

  • Create a workspace containing all of the submodules listed above.

  • To find the headers, you still need to add ../** (or ./** depending on your installation) in the Header Search Path main project.

  • Target should now know about the new libraries that it should link to. So, in the project, select Target, and in the assembly phases, go to the "Linking binaries to libraries" section. 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
  • The next step is to make sure that the linker finds everything that it needs: go to the project build settings and add the following to the other linker flags

     -all_load -ObjC 
  • On iOS, we need some graphic elements: move SoundCloud.bundle from the CocoaSoundCloudUI/ directory to your resources.

+1
source

Source: https://habr.com/ru/post/1379708/


All Articles