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

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

    ar crsT libaz.a libabc.a libxyz.a
    

    Here, you create archive of archives and then 'flatten' (thinning) result with T flag. Not sure how it'll work with same name .o files that might be contained within.

提交回复
热议问题