Is dlopen available on all versions of Mac OS X?

Q: Is dlopen available on all versions of Mac OS X?

A: Prior to version 10.3, dlopen was only available for Mac OS X as a third party library called dlcompat.

In order to better support the compilation of various software projects on Mac OS X, Apple rolled dlcompat into the operating system in Mac OS X 10.3. Then for Mac OS X 10.4, Apple rewrote dlopen and integrated it into the dyld project. Consequently, dlopen, dlclose, dlsym, and dlerror are all implemented using dyld calls.

Software written using a higher level framework in most cases should use the dynamic linking facilities available at that level. Core Foundation provides two mechanisms for dynamically linking to libraries and plug-ins: CFBundle and, layered on top of that, CFPlugIn. Cocoa programmers will probably want to use NSBundle.

Detailed information about using dynamic libraries on Mac OS X can be found in the ADC document "Introduction to Dynamic Library Programming Topics".

Document Revision History

Date Notes
2008-08-19 Fixed broken links.
2006-05-11 Moved to Darwin>Porting category.
2005-12-02 Changed title and content to reflect dlopen's inclusion in Panther and beyond.
2002-08-19 Describes how to dynamically link to libraries and plug-ins, typically done with dlopen.

Posted: 2008-08-19

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.