How to merge two “ar” static libraries into one?

前端 未结 6 707
悲哀的现实
悲哀的现实 2020-11-22 14:56

I have 2 static Linux libraries, created by ar cr, libabc.a and libxyz.a.
I want to merge them into one static library libaz

6条回答
  •  逝去的感伤
    2020-11-22 15:48

    ar -x libx264.a
    mkdir sub && cd sub
    ar -m ../libx264.a `ar -t ../libx264.a |sort|uniq|grep "\.o"`
    ar -x ../libx264.a
    

    now you have two version of "macroblock-10.o"

提交回复
热议问题