learn more...Static libraries are simply collections of object files arranged by the ar (archiver) utility. ar collects object files into one archive file and adds a table that tells which object files in the archive define what symbols. The linker, ld, then binds references to a symbol in one object file to the definition of that symbol in an object file in the archive. Static libraries use the suffix .a. You can convert a group of object files into a static library with a command like ar rcs libname.a foo.o bar.o baz.o You can also add one object file at a time to an existing archive. ar rcs libname.a foo.o ar rcs libname.a bar.o ar rcs libname.a baz.o In either case, libname.a will be the same. The options used here are:
There is rarely any need to use other options when building static libraries. However, ar has other options and other capabilities; the ar man page describes them in detail. |
||||||||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. link to this article |