Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between .so file and .a file?

I have read that .so is a dynamic library file and .a is a static library file.

While building openssl i gave the option ./Configure no-shared and it created a lot of .a files.

So, my question is will the other packages like apache will be able to use .a files from openssl?

for example libcrypto.a,

someone please advice me if im going enirely through wrong path.

like image 781
Droider Avatar asked Oct 28 '13 11:10

Droider


1 Answers

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)?

like image 144
Qben Avatar answered Oct 11 '22 00:10

Qben