I don't really understand what ar
utility does on Unix systems.
I know it can be somehow used for creating c libraries, but all that man page tells me is that it is used to make archives from files, which sounds similar to, for example, tar
....
The primary purpose is to take individual object files (*.o
) and bundle them together into a static library file (*.a
). The .a file contains an index that allows the linker to quickly locate symbols in the library.
Tar doesn't create files that linkers understand.
ar
is a general purpose archiver, just like tar
. It just "happens" to be used mostly for creating static library archives, one of its traditional uses, but you can still use it for general purpose archiving, though tar
would probably be a better choice. ar
is also used for Debian .deb
packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With