What are libtool's .la
files for? How are they used with a shared object?
An LA file is an archive used by Libtool, a generic library support script used for creating portable compiled libraries. It contains a library description that may include a reference to a shared or dynamic library.
Files with the “. a” extension are static libraries. These Libraries contain functions that are linked to the calling code at compile time and become part of the application.
A Linux in its very simple terms is a collection of pre-compiled pieces of code which are known as functions. Libraries are very useful as they provide reusable functions, classes and data structures. Some examples of libraries in Linux are glibc (GNU version of standard C library), libc (the C standard library).
so file is a compiled library file. It stands for "Shared Object" and is analogous to a Windows DLL. Often, package files will place these under /lib or /usr/lib or some place similar when they're installed.
It is a textual file that includes a description of the library.
It allows libtool
to create platform-independent names.
For example, libfoo
goes to:
Under Linux:
/lib/libfoo.so # Symlink to shared object /lib/libfoo.so.1 # Symlink to shared object /lib/libfoo.so.1.0.1 # Shared object /lib/libfoo.a # Static library /lib/libfoo.la # 'libtool' library
Under Cygwin:
/lib/libfoo.dll.a # Import library /lib/libfoo.a # Static library /lib/libfoo.la # libtool library /bin/cygfoo_1.dll # DLL
Under Windows MinGW:
/lib/libfoo.dll.a # Import library /lib/libfoo.a # Static library /lib/libfoo.la # 'libtool' library /bin/foo_1.dll # DLL
So libfoo.la
is the only file that is preserved between platforms by libtool
allowing to understand what happens with:
Without depending on a specific platform implementation of libraries.
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