I'm currently trying to port a C application to AIX and am getting confused. What are .a and .so files and how are they used when building/running an application?
A . a file is a static library, while a . so file is a shared object dynamic library similar to a DLL on Windows.
An SO file is a shared library used by programs installed on the Linux and Android operating systems. It contains common program functions and logic that multiple programs require access to.
In general, libraries are collections of data and functions written to be reused by other programmers or programs. On Linux, archive libraries end with the . a extension, and shared object libraries end with the . so extension.
a is a static library (archive), while . so is a shared library (shared object).
Archive libraries (.a) are statically linked i.e when you compile your program with -c option in gcc. So, if there's any change in library, you need to compile and build your code again.
The advantage of .so (shared object) over .a library is that they are linked during the runtime i.e. after creation of your .o file -o option in gcc. So, if there's any change in .so file, you don't need to recompile your main program. But make sure that your main program is linked to the new .so file with ln command.
This will help you to build the .so files. http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html
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