Reputation: 2327
I created a static library for my C++ code that depends on Boost, OpenSSL, CURL, and Threads in a CentOS 7 environment.
Is it possible to bundle libboost_system.a
, libssl.a
, libcrypto.a
, libcurl.a
, libpthread.a
alongside my C++ library into a single library?
Upvotes: 2
Views: 1095
Reputation: 371
.a
files are just archives; you can use the ar
command to manipulate them.
So you could extract all the objects (ar x
) from each of the libraries and then create a new library (ar a
) with all the individual files.
However this probably isn't a good idea because it means you have to keep rebuilding this each time one of the upstream libraries changes (eg due to a security issue being fixed).
It's normal for a program to have multiple library dependencies and inclusions.
Upvotes: 6