Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gdscott

macrumors newbie
Original poster
Jan 30, 2009
3
0
San Diego
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????
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
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?
 

gdscott

macrumors newbie
Original poster
Jan 30, 2009
3
0
San Diego
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)
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
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).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.