【发布时间】:2014-05-15 13:39:08
【问题描述】:
我有一个.a 文件,其中包含许多同名的对象(例如utils.o)。
当ar 实用程序只对名称进行操作时,如何提取这些对象?
【问题讨论】:
标签: static-libraries bsd unix-ar .a
我有一个.a 文件,其中包含许多同名的对象(例如utils.o)。
当ar 实用程序只对名称进行操作时,如何提取这些对象?
【问题讨论】:
标签: static-libraries bsd unix-ar .a
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 对象...
【讨论】: