Mohit Kumar <mohit.kumar@xxxxxxxxx> writes: > 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? This is not a gcc question. It is a binutils question. Or a Unix programming question. The answer is no. An archive is simply a collection of object files. There is no meaningful way to link one archive to another archive. If you will be using only the GNU linker, you could play some tricky games with linker scripts. For example, look at /usr/lib/libc.so on a typical GNU/Linux system. But I wouldn't describe that as a clean approach. Ian