tags:

views:

32

answers:

1

in general we use ar rcs command to create a static library on unix.

what does the flag 's' mean over here man page says

Do not generate an archive symbol table. This can speed up building a large library in several steps. The resulting archive can not be used with the linker. In order to build a symbol table, you must omit the S modifier on the last execution of ar, or you must run ranlib on the archive.

i am confused by the sentence "The resulting archive can not be used with the linker.".

do we have to use ranlib for creating the static library after the ar command? what is the purpose of the ranlib and how is it used?

+2  A: 

The ranlib utility creates an index in the library that the linker uses to do its lookups. Note that the omit index command in ar is uppercase S - the command to build the index is lowercase s, which you should be using. There is no need to use ranlib after running ar rcs.

anon
excellent ...now i got to know that i am getting confused with the case of letter "s"
Vijay Sarathi