Copying dynamic library (.dylib) into a framework (.framework)

I have two XCode projects: a framework and a client application.
My application depends on my framework and everything works fine with that — the framework is being recompiled everytime the app is, the projects build paths are set correctly, it’s completely okay.

Now the framework started using 3rd party dylib file, and it’s linked against the dylib.
I’ve even added a build phase to copy that library into the framework’s resources dir.

  • Apple Mach-O linker (id) warning : building for MacOSX, but linking against dylib built for iOS
  • .dll Equivalent on Mac OS X
  • Xcode 5 Framework/Library Search Path Absolute Address
  • Xcode, building and dylibs
  • Xcode 4 / iOS - Send an email using SMTP from inside my app
  • Download and execute iOS code dynamically at runtime
  • When i’m trying to run the application, everything compiles correctly, then i get this:

    dyld: Library not loaded: /usr/local/lib/libplplot.9.dylib
    Referenced from: /Users/railsmaniac/Projects/Study/Calculus of >approximations/Builds/Debug/XNMaths.framework/Versions/A/XNMaths
    Reason: image not found

    How can i fix it?
    Adding the library into client application’s resources doesn’t fix the problem.
    I can just place the library into the required location, but i prefer to keep it IN the framework.
    Is it possible?

    Solutions Collect From Internet About “Copying dynamic library (.dylib) into a framework (.framework)”

    It looks like your application is expecting the library to be found at a specific path on the system. If you are on OS 10.5+ you can use the new @rpath functionality to allow your application to link dynamically to your library.

    See this post for further details. It also shows the “old” way of doing this.