Embedding frameworks in a Mac App Bundle

I’m trying to add SDL and SDL_ttf frameworks to my application and I’ve done it the usual way: added them in the “Link Binaries with Libraries” section and added a copy files phase that copies them to the Frameworks directory. This does create a app bundle with embedded frameworks. However, when I run the application, I get this error:

dyld: Library not loaded: @rpath/SDL_ttf.framework/Versions/A/SDL_ttf
Referenced from:
/Users/matthew.davies/Library/Developer/Xcode/DerivedData/MacHub-ambfqujqxbxyiqapaoctvsucpdeu/Build/Products/Release/MacHub.app/Contents/MacOS/MacHub
Reason: image not found

  • How is Trello iPhone app developed?
  • What is the procedure for installing an external framework or library for Swift in XCode 6?
  • How to make an iOS asset bundle?
  • Xcode 6.1: file was built for x86_64 which is not the architecture being linked (i386)
  • Adding Framework and App Extension targets to IOS App project, am I doing it correctly?
  • Objective C classes within an iOS Swift-based dynamic framework
  • I am not sure what else to do so that the app can find the frameworks despite being embedded in its bundle.

    Any ideas please?

    Solutions Collect From Internet About “Embedding frameworks in a Mac App Bundle”

    I discovered the reason why in a comment on a webpage. I needed to set the “Runpath Search Paths” build setting to “@loader_path/../Frameworks” and the frameworks are found.

    Why frameworks are not automatically searched for in the Frameworks directory of an app bundle is a complete mystery to me? Are you listening Apple? 🙂