Build cocoa framework issue

  • Am 30.09.2007 um 23:37 schrieb Cloud.Student:
    > At first, I created a cocoa framework and included all external
    > library with headers. The framework was finished.
    > Then I created an application for testing. I imported the framework
    > created previously. Without a line of code, the console prompted
    > like these: " /usr/bin/ld: warning can't open dynamic library: /
    > Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libgsl.0.dylib
    > referenced from: /Users/Tiger/Project/GSLTesting/../../Desktop/GSL/
    > gsl.framework/gsl (checking for undefined symbols may be affected)
    > (No such file or directory, errno = 2)"
    > It is very odd, for I have included the requested lib files into
    > the gsl.framework.

      When you build a library or framework, the path of the folder in
    which it was built gets encoded in the framework. You have to set the
    "Installation Path" build setting if you want the framework to be in
    any other place than where you built it. Also, if your framework
    doesn't go into the standard Frameworks folder, but rather gets
    embedded in the Frameworks folder of your application's package
    bundle, you may want to start your path with the @executable_path
    placeholder to designate a path relative to the application's
    executable (e.g. @executable_path/../Frameworks/).

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
  • On 30 Sep 2007, at 18:19, Uli Kusterer wrote:

    > Am 30.09.2007 um 23:37 schrieb Cloud.Student:
    >> At first, I created a cocoa framework and included all external
    >> library with headers. The framework was finished.
    >> Then I created an application for testing. I imported the
    >> framework created previously. Without a line of code, the console
    >> prompted like these: " /usr/bin/ld: warning can't open dynamic
    >> library: /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libgsl.
    >> 0.dylib referenced from: /Users/Tiger/Project/GSLTesting/../../
    >> Desktop/GSL/gsl.framework/gsl (checking for undefined symbols may
    >> be affected) (No such file or directory, errno = 2)"
    >> It is very odd, for I have included the requested lib files into
    >> the gsl.framework.
    >
    > When you build a library or framework, the path of the folder in
    > which it was built gets encoded in the framework. You have to set
    > the "Installation Path" build setting if you want the framework to
    > be in any other place than where you built it. Also, if your
    > framework doesn't go into the standard Frameworks folder, but
    > rather gets embedded in the Frameworks folder of your application's
    > package bundle, you may want to start your path with the
    > @executable_path placeholder to designate a path relative to the
    > application's executable (e.g. @executable_path/../Frameworks/).

    <shameless plug>

    I wrote a short article about this just the other day. It contains
    some screenshots to help you find the right menu option:

    http://blog.brautaset.org/2007/09/22/embedding-cocoa-frameworks/

    Stig

    --
    http://code.brautaset.org
    http://blog.brautaset.org
  • Hi list.
    I want to build a customized cocoa framework.I want to package the
    GSL science library into a framework for an easy use. I have builded
    the gsl library from unix command line. Now it can run perfectly well.
    However, when I package the builded library to a framework, the issue
    came.

    At first, I created a cocoa framework and included all external
    library with headers. The framework was finished.
    Then I created an application for testing. I imported the framework
    created previously. Without a line of code, the console prompted like
    these: " /usr/bin/ld: warning can't open dynamic library: /Developer/
    SDKs/MacOSX10.4u.sdk/usr/local/lib/libgsl.0.dylib referenced from: /
    Users/Tiger/Project/GSLTesting/../../Desktop/GSL/gsl.framework/gsl
    (checking for undefined symbols may be affected) (No such file or
    directory, errno = 2)"
    It is very odd, for I have included the requested lib files into the
    gsl.framework.

    The I write some code to test the framework:
    #import <gsl/gsl_math.h>
    int main(int argc, char *argv[])
    {
    double result = gsl_max(10.0,50.0);
        return NSApplicationMain(argc,  (const char **) argv);
    }
    The application ended abnormally:
    dyld: Library not loaded: /Users/Tiger/Library/Frameworks/
    gsl.framework/Versions/A/gsl
      Referenced from: /Users/Tiger/Project/GSLTesting/build/Debug/
    GSLTesting.app/Contents/MacOS/GSLTesting
      Reason: image not found

    GSLTesting has exited due to signal 5 (SIGTRAP).
    There must be something wrong when I builded the framework. So anyone
    can tell me what is wrong here, or is willing to give me any
    instruction to build a good framework?
    Thank you in advanced.
    PS: I am a student who is learning Mac OS X programming now. So some
    help is really needed. Any help is appreciated.
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