0

I have this command on Windows: A.obj link /lib /out:B.lib A.obj

I want to do exactly the same but with GCC 4.8.5 in Linux

I tried with A.o ar rcs B.a A.o and it is generating a static library but i´m not really sure if it is the same ´cause my A.lib and my A.a have a significant size difference.

SAM
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 17 '22 at 11:12

1 Answers1

0

I found the answer on this blog https://www.cs.uaf.edu/2006/fall/cs301/lecture/12_04_linker.html

To link objects into libraries we use ar cr foo.a foo.o in Linux and link /lib /out:foo.lib foo.obj on Windows.

But, the problem I had was in fact that I also wanted to link libraries into the out library. If you need to do this you have to use ar crsT libab.a liba.a libb.a I found this on Linking static libraries to other static libraries

SAM
  • 1