Library Versions

Library version numbering is one area where Mac OS X differs from other Unix variants. In particular, the dynamic linker dyld checks both major and minor version numbers. Also, the manner in which library names carry the version numbers is different. On ELF systems, shared libraries are named with an extension similar to the following:

libname.so.major_version_no.minor_version_no

Typically, a symbolic link is created in the library named libname.so, which points to the most current version of the library. For example, on an ELF system like Solaris, libMagick.so.5.0.44 is the name of an actual library. If this is the latest installed version of the library, you can find symbolic links that point to this library in the same directory. These symbolic links are typically created during the installation process.

In this example, both libMagick.so and libMagick.so.5 are symbolic links that point to libMagick.so.5.0.44. Older versions of the library may also be present, such as libMagick.so.5.0.42. However, although older versions of the library may be present, whenever a newer version is installed, the symbolic links are updated to point to the latest version. This works because when you create a shared library, you need to specify the name of the library to be used when the library is called by a program at runtime.

Tip

In general, you should keep older versions of libraries around, just in case an application depends on them. If you are certain there are no dependencies, ...

Get Mac OS X for Unix Geeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.