View Full Version : Zthreads on Mac OS X Help

Jan 30, 2009, 05:23 PM
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????

Jan 30, 2009, 07:19 PM
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?

Jan 30, 2009, 07:51 PM
I ran the 'otool -L' on my executable called Zthread and this is what I got:

$ otool -L 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)

Jan 31, 2009, 12:16 PM
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).