What are those *.a or *.1a files ?
Roger Oberholtzer
roger
Thu Nov 18 02:43:11 PST 2004
On Thu, 2004-11-18 at 07:53, Xanana Gusmao wrote:
> Greetings,
>
> I compiled libxml2 and in the .libs directory, it generated among them 2 files:
>
> libxml2.a
A static library. If you make a program and use this, then the parts
used from libxml2.a are physically placed in your program. libxml2.a (or
libxml2.so) does not need to be around to run your program. It contains
everything from libxml2.a that it needs. Programs done this way are much
bigger and use more code memory. But they load a bit faster.
If there is a file called libxml2.so, that will be used instead. In that
case, the parts your program used in the library are NOT copied into
your program. libxml2.so must then be around when when your program
runs.
With GNU gcc, the linker directive to select to use a static library (if
available) would be like this:
gcc my,c -Wl,-Bstatic -lxlm2 -Wl,-Bdynamic -lxyz
All libraries after the '-Wl,-Bstatic' directive for which a .a file is
found will use that static version, ignoring any .so file also found.
The 'Wl,-Bdynamic' directive turns this off. All libs after that
directive will require .so libraries, ignoring any .a files found. As
you may guess, -Wl,-Bdynamic is the default behavior.
If you never link statically, you do not need the .a files - if there is
a .so file - all libraries do not default to make bith static and
dynamic versions of their libraries. The .la file will be installed in
the right place by 'make install'.
> libxml2.1a
I bet the extension is 'la'. It is a text file that describes the
particulars of the library. This helps 'configure' and the like
determine if an installed library has needed features. And where it may
be located.
>
> What are these files for ?
>
> Thanks
>
> X
>
> _______________________________________________
> Linux-users mailing list
> Linux-users at linux-sxs.org
> http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
>
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
+????????????????????????????+???????????????????????????????+
? Roger Oberholtzer ? E-mail: roger at opq.se ?
? OPQ Systems AB ? WWW: http://www.opq.se/ ?
? Nybrogatan 66 nb ? Phone: Int + 46 8 314223 ?
? 114 41 Stockholm ? Mobile: Int + 46 733 621657 ?
? Sweden ? Fax: Int + 46 8 314223 ?
+????????????????????????????+???????????????????????????????+
More information about the Linux-users
mailing list