Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个.a文件,其中包含许多具有相同名称的对象(utils.o例如)。ar当实用程序仅对名称进行操作时,如何提取这些对象?
.a
utils.o
ar
man ar揭示了这个修饰符:
man ar
N Uses the count parameter. This is used if there are multiple entries in the archive with the same name. Extract or delete instance count of the given name from the archive.
因此,例如,您可以使用从存档ar xN 5 libfoo.a utils.o中提取第 5 个对象...utils.o
ar xN 5 libfoo.a utils.o