Compiling PIC object with static library

view story

http://stackoverflow.com – I am generating a shared library on linux and I am using this xml parser "mini xml" to parse some xml config files for my library. The thing I want is not to have any dependency on this xml parser so I want to use the static libmxml.a library provided by the vendor instead of using libmxml.so which is also there along with libmxml.so such that my shared library does not depend on libmxml when deployed. I have tried following but it doesnt work. gcc -fPIC -o myobject.o -static -lmxml -c myobject.c but it gives warning Linker input unused because linking not done What am i missing? (HowTos)