Why create shared library out of a set of static libaries in C?

102 Views Asked by At

I'm currently working on an old program written in C that consists of a shared library and some utilities. The library is built by first building every subproject as a static c library and then linking those together in a shared library.

The layout of the project is very similar to the project in this question.

Previously I built my C programs by linking every object build together. What is the benefit of using static archives instead of object files in this case?

1

There are 1 best solutions below

0
On

What is the benefit of using static archives instead of object files in this case?

There is no particular benefit, but building multiple archive libraries which are later linked into a single binary or shared library can make Makefiles easier to write. However, see "Recursive Make Considered Harmful".