Dyld Error Message: Library not loaded

OS X 10.9

Xcode 5.0


I have an Xcode project that contains a sub-project. The sub project is a framework. When I build and run from within the project all works well. However, when I deploy the application and run it from “Finder” I get the error:


Dyld Error Message: Library not loaded

Reason: image not found


My Framework does not appear in the "/Library/Frameworks" directory even though I have an entry in the projects target Build Phase "Copy Files" section. What am I missing???

Mac mini, OS X Mavericks (10.9.1)

Posted on Jan 1, 2014 6:13 PM

Reply
5 replies

Jan 3, 2014 1:28 PM in response to David-11

Xcode is supposed to do this for you automatically. But to get that to work, you have to start with a set of ready-to-build frameworks. If you have something that isn't already born to be a framework, then you have to do it manually. Create a new "Run Script" phase and add "install_name_tool" there. You will have to look up the command line arguments and inspect the Xcode build environment variables in order to construct the command to execute.

Jan 7, 2014 1:23 PM in response to David-11

I mean something that is born a framework. For example, I have a script that I can run that converts a congifure-based (automake) project into a Framework.But it isn't worth my while to try to get that working in Xcode. I have to do that manually.


In your case, you should be able to just add your framework project to your workspace, add the framework as a linked binary, and it should work. I don't actually have any such frameworks myself. That is why I say "should". If it doesn't, try explicity adding the framework during the "copy files" phase. Maybe that is what it needs.


I don't actually know how well this works in practice. It is what people tell me I should do, but I don't because my frameworks don't fit the model. It is supposed to run install_name_tool automatically and correctly sign the framework, if you are code signing. If you can't get it to work, you can always use my method where I manually copy the framework in a "copy files" phase and then manually run install_name_tool in a "run script" phrase. You can even do the code signing in a separate "run script" phase if you need that.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Dyld Error Message: Library not loaded

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.