Difference between .so file and .a file? Difference between .so file and .a file? apache apache

Difference between .so file and .a file?


Basically the static library can be compiled into another application at link time. In your example Apache could use libcrypto.a during build time and include it in the Apache httpd application.

A dynamic .so library can be loaded and unloaded at runtime and you have a better flexibility to change what Apache should support without recompiling the Apache binaries.

Using Apache as example the dynamic loading of .so files are described in the Dynamic Shared Object (DSO) section in the documentation. You can also find links to the installation section which describe how to include static libraries at build time.

There is a good question about this that could be good to read, and that provide mote details in the subject.

Difference between shared objects (.so), static libraries (.a), and DLL's (.so)?


If A.a is static library and two different programs want to use it. A.a is created two times for each program. while If A.so is dynamic library than two programs access same file.Its mean that you are using reference in library.

If your library is going to be shared among several executables(like apache and openssl), it often makes sense to make it dynamic to reduce the size of the executables. Otherwise, definitely make it static.

In your case you must create dynamic library


Please read -http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html.

It is a very good tutorial with example.

you will learn -

  1. what is static library (.a) and how to make it.
  2. what is shared library (.so) and how to make it.
  3. difference with .ddl (windows os)