Object files not properly added to archive on mac

后端 未结 1 1371

I am trying to build an archive from a collection of object files. I am doing this with

ar -rs my_archive.a foo.o bar.o other_object_files.o.

On

1条回答
  •  时光说笑
    2020-12-20 01:45

    The problem is that apparently common symbols are not added by default.

    Option 1:

    ar -rs my_archive.a foo.o bar.o other_object_files.o ranlib -c my_archive.a

    Option 2:

    libtool -c -static -o my_archive.a foo.o bar.o other_object_files.o

    0 讨论(0)
提交回复
热议问题