views:

1896

answers:

2

Has anyone found a fix for this? I read that it has something to do with new dylib format in Snow Leopard...

(This is the lib I get back from MacPorts.)

Thanks, rui

+2  A: 

What are you trying to use that library with? Chances are you have an old version of some build tool or app. Have you updated all of your MacPorts installation?

sudo port selfupdate
sudo port -u upgrade outdated

EDIT: Based on your additional information, more questions:

You have -I /sw/include and -L /sw/lib which are standard locations for Fink, not MacPorts (/opt/local/{include,lib}). In general, it's not a good idea to mix packages from Fink and MacPorts. Are you actually pulling in anything from Fink? If so, are all the Fink packages up-to-date?

If that doesn't resolve the issue, are you building on 10.5 and, if so, which 10.5? Or are you building on 10.6 an app targeted for 10.5 and 10.6? Make sure you have the latest Xcode in either case.

EDIT: It is very difficult to diagnose problems like this based on sketchy information. You say Leopard in your latest comment but then you say you are using the 10.6 SDK. At this point, all I can suggest is that you make sure you have the latest Xcode updates installed and, if you want more help, update the question with a more complete description of what you are trying to do and exactly how and where you are trying to do it, including versions of tools like gcc, et al. Good luck!

Ned Deily
This is what I ran before compiling wxWidgets, GraphicsMagick and finally, my app. export CFLAGS="=-O -g -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -I/sw/include/ -m32" export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk,-L/sw/lib/ -m32" sudo port selfupdate sudo port clean -f installed sudo port uninstall -f installed sudo port install freetype zlib jpeg libpng tiff squish
ruibm
That was a very good point, but even after recompiling everything with the correct prefixes (macports only) Leopard OS' still get 0x80000022. :( I'm adding the following to my compile flags -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.6.sdk
ruibm
My machine runs Snow Leopard. I'm compiling using the latest SDK 10.6 and macosx-version-min to 10.5. I think my compilation is fine. I believe now that the problem lies in the libs provided by macports that seem to be only compiled for 10.6. When I bundle my app with these libs, the dylib load crashes with unknown instruction in Leopard (10.5). Thanks for your help diagnosing!
ruibm
Yes, that would very likely be the problem. You could probably trick MacPorts into building 10.5 targeted libraries on 10.6. Or, if you have access to a 10.5 machine, it just might be easier to build everything there!
Ned Deily
A: 

We have this same problem whenever we try to run an executable compiled and linked on Snow Leopard without -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 and then try to run it on Leopard. Note the -isysroot setting is different than in your comment above.

Simeon Fitch