How to merge two "ar" static libraries into one?

linux, static-libraries, unix-ar

Solution

You can extract the object from both the `.a` files and create your `.a` file using the extracted `.o`s:

ar -x libabc.a
ar -x libxyz.a
ar -c libaz.a  *.o

Problem

I have 2 static Linux libraries, created by `ar cr`, `libabc.a` and `libxyz.a`. I want to merge them into one static library `libaz.a`. How can I do this. I want to create a merged static library, not to give both libraries to final link of applications.

Original source

Related problems