Re: Compiling Shared Objects/Libraries
Re: Compiling Shared Objects/Libraries
- Subject: Re: Compiling Shared Objects/Libraries
- From: Douglas Davidson <email@hidden>
- Date: Tue, 29 Jan 2002 13:41:31 -0800
On Tuesday, January 29, 2002, at 12:33 PM, Richard Schreyer wrote:
I'm looking through dyld.h, and no single function seems to be jumping
out at me saying that it's equivalent to dlopen().
From what I'm seeing, I guess that I have to create a NSObjectFileImage
to represent the .dylib file, and then use NSLinkModule() (can I use
anything for the moduleName string?) to load the library?
Finally, it appears that NSLookupAndBindSymbol() is used instead of
dlsym().
Is all of this right, and is there anyplace I can find some real
documentation for dyld.h? It's barely mentioned on developer.apple.com.
man 3 NSModule
will give you the documentation for these functions.
If you are creating the executable you are trying to load, you may find
it simpler to bundle it and use CFBundle to load it. The dyld functions
will give you more precise control over various options, at the expense
of a certain increase in complexity.
Douglas Davidson