Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6207505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:38:30+00:00 2026-05-24T05:38:30+00:00

I am trying to create and then add the dylib to a project. I

  • 0

I am trying to create and then add the dylib to a project.
I created it by using the “Cocoa-Library” template and setting the type to “Dynamic” (not sure if it should be dynamic or static…). Then I created a simple obj-c class called Test and wrote a method in it that prints out something to console.

I compiled and used the generated .dylib file and put it in another project. Now whenever I try to use it, I get this message on runtime”

dyld: Library not loaded: /usr/local/lib/TESTLib.dylib
  Referenced from: /Users/***/Library/Developer/Xcode/DerivedData/TestingDYLIB-axmoocnxbwznoyerfogosumqufxc/Build/Products/Debug/TestingDYLIB.app/Contents/MacOS/TestingDYLIB
  Reason: image not found

I also created a Copy File phase and set the destination to “Frameworks”. I still get the same error.
What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:38:31+00:00Added an answer on May 24, 2026 at 5:38 am

    The issue is not where Xcode is looking for the library at compile time, which is what Simon Whitaker’s answer addresses.

    The issue is that the application which uses the dylib cannot find it at runtime. When an application is built that uses a dynamic library, it copies the install_name of the dylib into the output binary.

    Creating a copy files phase and copying the dylib to the Frameworks subdirectory of the app’s bundle is the right thing do do.

    However, you need to do an additional step. You need to compile the dynamic library with an install_name appropriate for a bundle app. By default, a dynamic library is created with an install_name of /usr/local/lib. The app can’t find your library there because it doesn’t exist. Even if you put the library there, your users certainly won’t have it, so that would be the wrong solution.

    The right solution is bundling the library with the app. To set the install name for the dynamic library, go into the dynamic library project and set the “Dynamic Library Install Name” option to: @executable_path/../Frameworks/libmydynamiclibrary.dylib

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an array in MIPS Assembly, and then add all the
I am following a tutorial, and trying to create a database, then add put
I am trying to create an empty model, populate it and then add it
I trying to create a custom object that contains image, and then add this
I'm trying to create an associative array, create an empty array, and then add
I trying to create iframe then add script to it and script will run.
I'm trying to create a button that fades out and then in when I
I'm trying to create a widget within the module and then load that widget
I'm trying to create a procedure that will enter data and then return a
I'm trying to create a simple example to understand how to store then retrieve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.