ar crf library.a file1.o file2.o
ar rvs library.a.a file1.o file2.o
ar rs liblprprint.a lpr_print.o
ar rcs library.a file1.o file2.o
Actually I have googled about the static library and I found these 4 commands that can be used to create a static library in gcc.Out of 2 are searched in the previous answers of stackoverflow .The thing I want to know is, Is there any difference between these 4 commands? Do they differ in creating a static library in any aspect. because we can follow one command to create a static library but why do we have 4 commands to create a static library. These made me believe there must be a difference between all the 4 commands.I tried it on google but they gave the command but i did not find the differnces between them.So does anybody know why do we got 4 commands to work on while creating a static library?What would be the difference between them? I mean rs,rcs,rvs, why we have them?