This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Statically linking a shared library to another library to be statically linked


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]