[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: loadlib for Mac OS X
- From: Asko Kauppi <asko.kauppi@...>
- Date: Tue, 21 Dec 2004 23:00:11 +0200
I'd like to say (native) OS X development is not this complicated. But
it is.. :) That's why I'm not doing any. ;P
21.12.2004 kello 20:50, Mike Pall kirjoitti:
Dario Accornero wrote:
All NS* APIs on OS X require at least Objective-C support, and most
require linking against Cocoa as well. On the other hand, CFBundles
and _dyld_ functions are available to all kinds of OS X
Well, I encountered quite a few difficulties using the CF* and _dyld_*
functions. After some research and a few experiments later I discovered
that the specific NS* APIs for dynamic loading reside in a pure C
and *do not* use ObjC and *do not* drag in Cocoa (unless the bundle
is written in ObjC or uses Cocoa -- which is of course expected).
Tracing the process reveals that only /usr/lib/libSystem.B.dylib and
/usr/lib/system/libmathCommon.A.dylib are loaded (which are the
equivalents of libc and libm on less excentric operating systems).
So unless I get convincing evidence to the contrary I'll stay with
the API currently used in the code. It also seems to be what everone
else is using ('else' being Perl, Python, Ruby and many other open
source projects that have to load plugins).
Roberto Ierusalimschy wrote:
Ok. But which set of functions should we
use? NSCreateObjectFileImageFromFile or NSAddImage? Or neither?
NSCreateObjectFileImageFromFile only loads bundles, NSAddImage only
During my search for more info on this topic I found a simple
to allow loading bundles and dylibs with the same code. I'll update my
loadlib patch asap.