Library extension .a/.so

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Apr 26 14:37:15 UTC 2005


On Mon, Apr 25, 2005 at 09:41:30PM -0400, John Wildberger wrote:
> What is the difference in libraries ending with extension .a and .so.
> Can one convert  from somelib.a to somelib.so?

.a is static libraries (they get linked into end binary of the program).
.so is shared object (dynamic libraries) (they are loaded at run time
using whichever version matching the soname is on the system.

Using the shared ones saves ram (since multiple programs using the same
lib can share the copy in memory, save disk space (program doesn't
include the lib code itself it uses the one copy the system has), and
allows easier bug fixes and upgrades of the library code (if a small bug
is found in the lib, a new version can be installed that fixes the bug
hence fixing the bug in all programs using the lib.)

Of course the program won't run if the system doesn't have the lib
installed which is why staticly linked programs can have uses if you
want to be sure it will run on anyone's system no matter what, or in
cases where you are trying to recover from a broken lib install.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list