1

我有一个.a文件,其中包含许多具有相同名称的对象(utils.o例如)。ar当实用程序仅对名称进行操作时,如何提取这些对象?

4

1 回答 1

3

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

于 2014-04-03T15:59:04.820 回答