1
我有一個.a
文件,其中包含許多共享相同名稱的對象(例如,utils.o
)。 當ar
實用程序只對名稱進行操作時,如何才能提取這些對象?從庫中提取具有相同名稱的多個對象
我有一個.a
文件,其中包含許多共享相同名稱的對象(例如,utils.o
)。 當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
對象...
只有GNU。 BSD版本(例如OSX上)沒有這個版本。 – OrangeDog