Hi Thor,
as far as I know, Mach-o is now the Macintel linker. It supports only one format, dylib, which can encapsulate PPC and Intel targets. dlopen / dlsym / dlclose are not supported,
according to
http://developer.apple.com/technotes/tn2002/tn2071.html; dlopen can be emulated by:
const char *filename = argv[1];
NSObjectFileImage *fileImage;
NSModule handle;
NSObjectFileImageReturnCode *returnCode = NSCreateObjectFileImageFromFile(filename, &fileImage);
if(returnCode == NSObjectFileImageSuccess)
{
handle = NSLinkModule(fileImage,filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(fileImage);
if (handle) {
/* code here */
}
}
However, this appears to work only for bundles, not shared libs. I tired the standard dlopen way, and seems to work fine. Apple is really not clear about all that.
Anyway, in order to cope with the current issue we experience (and we're pretty much in a hurry), if Psyclone had been compiled on a PPC mac, it might be useful to recompile it on a macintel, using, say, xcode2/Mach-o, to generate an executable that can load code for both PPC and Intel, which I don't think was possible on a PPC-mac-os-x.
What do you think?
eric