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

前端 未结 6 847
悲哀的现实
悲哀的现实 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:53

    You can extract the object from both the .a files and create your .a file using the extracted .os:

    ar -x libabc.a
    ar -x libxyz.a
    ar -c libaz.a  *.o
    

提交回复
热议问题