user635064
user635064

Reputation: 6247

dyld not loaded problem xcode 4

I dragged skype fromwork into my frameworks folder and then imported <Skype/Skype.h>. When I run, it gives me this error:

dyld: Library not loaded: @executable_path/../Frameworks/Skype.framework/Versions/A/Skype
  Referenced from: /Users/test/Library/Developer/Xcode/DerivedData/TEST-edktdfqvxhqmfpfqrdqrmjojnfly/Build/Products/Debug/TEST.app/Contents/MacOS/TEST
  Reason: image not found

Upvotes: 9

Views: 6043

Answers (3)

ObeyTheFist
ObeyTheFist

Reputation: 46

Just as a side note, I spent months trying to track down an answer to this problem, always seeing this answer but never being able to get it to work.

MY MISTAKE: The "Copy Files" build phase is not shown by default. I was seeing the "Copy Bundle Resources" phase and wrongly assuming that was where I needed to list the framework.

At the bottom of the Build Phases pane click on Add Build Phase. "Copy Files" is listed there.

Upvotes: 3

Ronaldo Nascimento
Ronaldo Nascimento

Reputation: 1571

Doesn't work for me. I had to make a link to the framework in the ~/Library/Developer/..../Debug/../Frameworks for it to work.

Upvotes: 1

sergio
sergio

Reputation: 69027

Try setting the "Library Search Path" build settings for your project.

In Xcode 4.x:

You need to drag the .framework from the Project navigator to the Copy Files build phase.

In Xcode 3.2.x:

  1. Choose Project > New Build Phase > New Copy Files Build Phase

  2. In the Destination drop down box select Frameworks

  3. Close the Copy Files Phase Info window to return to the Xcode main window

  4. In the Groups & Files pane expand Targets > YourApplicationExectuable, where you should now see a Copy Files entry

  5. Still in Groups & Files pane drag your framework into the Copy Files entry

  6. Recompile

If you don't do this, the framework will not be actually copied into your application bundle, so it will not be found when your app tries loading it into memory.

Upvotes: 20

Related Questions