O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shared Libraries and dlopen

If you don’t want to use (or can’t use) NSBundle for loading plug-ins, you can load a shared library instead. Loading a shared library does not give you ready access to resources like NSBundle does.

Mac OS X has a choice of API for manually loading bundles and shared libraries. There is the NSModule API, which includes functions such as NSCreateObjectFileImageFromFile(). Prior editions of this book described this mechanism. It has been deprecated in Mac OS X 10.5, and the documentation manpages have been removed. You can find information in the header located at /usr/include/mach-o/dyld.h.

dlopen()

dlopen() is used to open a shared library or a bundle at a given path:

void* dlopen (const char* path, int mode);

dlopen() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required