This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Statically linking a shared library to another library to be statically linked
- From: Mohit Kumar <mohit dot kumar at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 May 2005 17:52:37 +0530
- Subject: Statically linking a shared library to another library to be statically linked
- Reply-to: Mohit Kumar <mohit dot kumar at gmail dot com>
Hi All,
First of all, apologies for such a cryptic subject, even I took some
time to figure out how should I frame the subject but could not think
of any better way.
I am stuck with the following scenario:
Suppose I have three files: libone.a, libtwo.a and libmain.so, and I
want to implement the followinf hierarchy:
libmain.so
|-----libtwo.a
|-----libone.a
As far as linking libtwo.a to libmain.so is concerned I am aware I
need to use '-l' flag at link time.
But is there a way I can link a .a file to another .a file?
I am aware I can do the following:
ar x libone.a ----> generates all the .o's
ar q libtwo.o *.o's
However I am looking for a cleaner way.
Any help in this regard would be highly appreciable.
Thanks,
Mohit