dyld: Library not loaded: & embedded app resources

  • How do I stop my app from looking in /Library/Frameworks for third
    party frameworks?  These frameworks were originally added to the
    project from that path, but now I want the app to load them from
    within the app bundle.  I have followed all the steps to prepare my
    frameworks to be embedded (http://rentzsch.com/share/
    embeddingFrameworks.mov), created a copy file rule for them, but the
    app still wants to load them from /Library/Frameworks.

    dyld: Library not loaded: /Library/Frameworks/EKFormKit.framework/
    Versions/A/EKFormKit
    <blah>
    Reason: image not found

    How can I persuade the app to stop looking there for resources?

    Thanks,

    --Brian
  • Did you link to the correct copy of the library in the Link Binary
    With Libraries build phase?

    Christiaan

    On 21 Sep 2007, at 10:25 AM, Anthony B Arthur wrote:

    > How do I stop my app from looking in /Library/Frameworks for third
    > party frameworks?  These frameworks were originally added to the
    > project from that path, but now I want the app to load them from
    > within the app bundle.  I have followed all the steps to prepare my
    > frameworks to be embedded (http://rentzsch.com/share/
    > embeddingFrameworks.mov), created a copy file rule for them, but
    > the app still wants to load them from /Library/Frameworks.
    >
    > dyld: Library not loaded: /Library/Frameworks/EKFormKit.framework/
    > Versions/A/EKFormKit
    > <blah>
    > Reason: image not found
    >
    > How can I persuade the app to stop looking there for resources?
    >
    > Thanks,
    >
    > --Brian
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • hmm, no I did not tamper with this part of the project.  It is
    unclear, from the info panel,  what path these are linked to and how
    to change that.  So far, all I've done is delete the relevant
    frameworks from the linked frameworks group (because I copied the
    source from another host, so the resource names were red), and re-
    added each one after compiling them locally, but the app still wants
    to load them from /Library/Frameworks.  Short of recreating the
    project from scratch, surely there is a configuration setting in
    xCode to stop that.

    Also, to clarify my question a bit, I suppose that the command
    install_name_tool can be used to operate on the app binary and fix
    this, but then I have the same problem again the next time I compile.

    Any help is appreciated.

    --Brian

    On Sep 21, 2007, at 4:41 AM, Christiaan Hofman wrote:

    > Did you link to the correct copy of the library in the Link Binary
    > With Libraries build phase?
    >
    > Christiaan
    >
    > On 21 Sep 2007, at 10:25 AM, Anthony B Arthur wrote:
    >
    >> How do I stop my app from looking in /Library/Frameworks for third
    >> party frameworks?  These frameworks were originally added to the
    >> project from that path, but now I want the app to load them from
    >> within the app bundle.  I have followed all the steps to prepare
    >> my frameworks to be embedded (http://rentzsch.com/share/
    >> embeddingFrameworks.mov), created a copy file rule for them, but
    >> the app still wants to load them from /Library/Frameworks.
    >>
    >> dyld: Library not loaded: /Library/Frameworks/EKFormKit.framework/
    >> Versions/A/EKFormKit
    >> <blah>
    >> Reason: image not found
    >>
    >> How can I persuade the app to stop looking there for resources?
    >>
    >> Thanks,
    >>
    >> --Brian
    >> _______________________________________________
    >> MacOSX-dev mailing list
    >> <MacOSX-dev...>
    >> http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • If you build the framework from source, the best way is to add a
    subproject for it in your main project file (drag the xcode project
    for the framework to the groups of the main project). Then add the
    framework as a dependency to the main project target. Then drag the
    product framework from inside the linked xcode project  group to the
    Linked Frameworks group in the main project. Next you need to drag
    the framework to a Copy Files build phase and (I think) to the Link
    Binary With Libraries build phase. There are several "copies" of the
    framework in your main project, and it is important which one you
    drag there, though I'm not 100% sure which one it is, I think it's
    the one from the linked xcode project (definitely not from Finder).
    The Get Info panel does not show a difference, but internally there
    is a difference.

    Christiaan

    On 21 Sep 2007, at 11:03 AM, Anthony B Arthur wrote:

    > hmm, no I did not tamper with this part of the project.  It is
    > unclear, from the info panel,  what path these are linked to and
    > how to change that.  So far, all I've done is delete the relevant
    > frameworks from the linked frameworks group (because I copied the
    > source from another host, so the resource names were red), and re-
    > added each one after compiling them locally, but the app still
    > wants to load them from /Library/Frameworks.  Short of recreating
    > the project from scratch, surely there is a configuration setting
    > in xCode to stop that.
    >
    > Also, to clarify my question a bit, I suppose that the command
    > install_name_tool can be used to operate on the app binary and fix
    > this, but then I have the same problem again the next time I compile.
    >
    > Any help is appreciated.
    >
    > --Brian
    >
    > On Sep 21, 2007, at 4:41 AM, Christiaan Hofman wrote:
    >
    >> Did you link to the correct copy of the library in the Link Binary
    >> With Libraries build phase?
    >>
    >> Christiaan
    >>
    >> On 21 Sep 2007, at 10:25 AM, Anthony B Arthur wrote:
    >>
    >>> How do I stop my app from looking in /Library/Frameworks for
    >>> third party frameworks?  These frameworks were originally added
    >>> to the project from that path, but now I want the app to load
    >>> them from within the app bundle.  I have followed all the steps
    >>> to prepare my frameworks to be embedded (http://rentzsch.com/
    >>> share/embeddingFrameworks.mov), created a copy file rule for
    >>> them, but the app still wants to load them from /Library/Frameworks.
    >>>
    >>> dyld: Library not loaded: /Library/Frameworks/EKFormKit.framework/
    >>> Versions/A/EKFormKit
    >>> <blah>
    >>> Reason: image not found
    >>>
    >>> How can I persuade the app to stop looking there for resources?
    >>>
    >>> Thanks,
    >>>
    >>> --Brian
    >>> _______________________________________________
    >>> MacOSX-dev mailing list
    >>> <MacOSX-dev...>
    >>> http://www.omnigroup.com/mailman/listinfo/macosx-dev
    >
  • Il giorno 21/set/07, alle ore 11:03, Anthony B Arthur ha scritto:

    > hmm, no I did not tamper with this part of the project.  It is
    > unclear, from the info panel,  what path these are linked to and
    > how to change that.

    When you link to a library, its install name is embedded in the
    executable. The install name can be fixed on a binary with
    install_name_tool, or, if you have the source, by changing the
    framework's install name in its target settings (if the Xcode project
    is available) or link flags (man gcc should help).

    At worst, you could make a copy of the framework, run
    install_name_tool on it, and link to that. If you need the framework
    to live in Library, you can make a shell script build phase that
    copies the framework on-the-fly.

      - °_______________________________________________
    MacOSX-dev mailing list
    <MacOSX-dev...>
    http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • Thanks to all who responded.  I figured out what was wrong, something
    I swear I had done, but somehow the setting was lost.  But the simple
    solution was setting the build Install Directory value to
    @executable_path/../Frameworks for every relevant framework.  That
    was it!

    --Brian

    On Sep 21, 2007, at 5:27 AM, Emanuele ° Vulcano wrote:

    >
    > Il giorno 21/set/07, alle ore 11:03, Anthony B Arthur ha scritto:
    >
    >> hmm, no I did not tamper with this part of the project.  It is
    >> unclear, from the info panel,  what path these are linked to and
    >> how to change that.
    >
    > When you link to a library, its install name is embedded in the
    > executable. The install name can be fixed on a binary with
    > install_name_tool, or, if you have the source, by changing the
    > framework's install name in its target settings (if the Xcode
    > project is available) or link flags (man gcc should help).
    >
    > At worst, you could make a copy of the framework, run
    > install_name_tool on it, and link to that. If you need the
    > framework to live in Library, you can make a shell script build
    > phase that copies the framework on-the-fly.
    >
    > - °
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today