Zthreads on Mac OS X Help

Discussion in 'Mac Programming' started by gdscott, Jan 30, 2009.

  1. macrumors newbie

    Joined:
    Jan 30, 2009
    Location:
    San Diego
    #1
    I created a simple C++ program on Macbook Pro (Leopard 10.5.6) to play with the ZThreads open source framework. I downloaded the ZThread 2.3.2 source from sourceforge and compiled it (eg.. ./configure -> make -> make install). I built my test application using Eclipse and linked the ZThread.la library into my application. The application compiles/links successfully but when I try run my application within the Eclipse IDE, I get the following errors:


    dyld: lazy symbol binding failed: Symbol not found: __MPIsFullyInitialized
    Referenced from: /usr/local/lib/libZThread-2.3.2.dylib
    Expected in: flat namespace

    dyld: Symbol not found: __MPIsFullyInitialized
    Referenced from: /usr/local/lib/libZThread-2.3.2.dylib
    Expected in: flat namespace

    Any ideas on what could be causing these errors????
     
  2. macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #2
    You need to link to the CoreServices.framework.

    Some digging around with the 'nm' command-line utility reveals the symbol
    __MPIsFullyInitialized is defined in /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework.

    If you do an 'otool -L' on your executable, does CoreServices show up as being linked against it?
     
  3. thread starter macrumors newbie

    Joined:
    Jan 30, 2009
    Location:
    San Diego
    #3
    I ran the 'otool -L' on my executable called Zthread and this is what I got:

    $ otool -L Zthread
    Zthread:
    /usr/local/lib/libZThread-2.3.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.3)
     
  4. macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #4
    What happens when you compile/link/execute outside the Eclipse IDE?
    (I'm not sure what kind of environment your executables inherit when they're run from Eclipse.)

    You can also explicitly set the DYLD_FRAMEWORK_PATH environment variable to the /System/Library/Frameworks, i.e. in the shell:

    export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks

    Then launch your executable from the shell (see the dyld man page for more useful dyld environment variables).
     

Share This Page