gcc - How can I create a static library that links against another library and can be used by a third program that links both the libraries? -
sorry confusing wording.
basically want create static library (libone.a
) needs link static library (libtwo.a
). libone.a
and libtwo.a
both linked in statically program (let's call program
) doing following:
$(cc) -o program something.o anotherthing.o -l/path/to/lib -lone -ltwo
whenever program
makes call method in libtwo.a
should go libtwo.a
loaded program
. whenever program
makes call method in libone.a
calls method in libtwo.a
, should call libtwo.a
embedded in when libone.a
created. yes understand blow file size loading 2 of same libraries i'm ok that.
the reason why i'm attempting because program
have using openssl (in case libcrypto.a
) , static library using libcrypto
. have requirement in library openssl fips valid (i.e. fips_mode_set(1)
) doing break program
. in short want libraries of openssl used. 1 called program
natively should use own , 1 called library should use 1 linked , fips valid.
is possible?
is possible?
no, can not done archive libraries (it can done shared libraries requires great care avoid symbol collisions).
Comments
Post a Comment