ar on an existing .a file?

前端 未结 2 1994
醉话见心
醉话见心 2021-01-20 17:52

Essentially, what I want to do is this:

gcc foo.c -o foo.o
ar rcs foo.a foo.o
gcc bar.c -o boo.o
ar rcs bar.a bar.o foo.a

I want to archive

2条回答
  •  悲哀的现实
    2021-01-20 18:43

    ar rcs foo.a foo.o
    cp foo.a foo2.a
    gcc -c bar.c
    ar rs foo2.a bar.o
    

    And perhaps use foo.a instead of foo2.a if you don't need to keep it in its original form.

提交回复
热议问题