|
|
3.4. Shared LibrariesMost if not all the applications we have ported use shared libraries. However, different operating systems have differences in creating and naming these shared libraries. In Linux, shared libraries may end with different file extensions. Shared libraries may end with .so or so.1.0 extensions. Shared libraries that end in .so with the extra dot followed by a number and a dot and another number are versioned libraries. The first number stands for the major number; the second number represents the minor number. Sometimes the extension comes with another dot and a number called the release number. The last dot and the release number are optional. Here is the format of the library filename: lib<name>.so.<major>.<minor>.<release> The major, minor, and release numbers signify different changes that are made to the library. Here are some guidelines for incrementing the major, minor, and release numbers:
To create shared libraries in Linux, use the shared option in the compile arguments; this tells GNU ld to create a shared library rather than an application. Here is an example: $ gcc o libfoo.so shared fpic foo.c |
|
|