Search code examples
xcodemacosframeworksdylibinstall-name-tool

Include a dylib into an OS X Framework


Today, I am trying to make an Objective-C wrapper of the mediainfo library. I have also written two demo projects (one written in Objective-C and the other one in Swift).

I would like to include the dylib of mediainfo into the framework bundle so that users don't see it. My intent is to create a framework which is draggable on my other Xcode projects.

I tried to use install_name_tool and otool to locate the path of the dylib but nothing happens. Either the application cannot to load the dylib or Xcode crashes.

The code is available on GitHub. I try to compile with Xcode 7 and it crashes when a compile the sample applications but it don't crash when I only compile the framework.


Solution

  • I found a solution :

    • As every dylib, we have to use install-name-tool to specify the install-paths.

    • We also have to codesign the framework and the contained dylib with our developer ID.

    screenshot of the solution in Xcode