Question about libraries and object files!

From: Razvan (mihai11_at_mailcity.com)
Date: 08/31/03


Date: 31 Aug 2003 08:13:38 -0700

HI!

        As I read from the manual called "Developping software with GNU" a
library
is just a collection of object files archived with ar. The table of
symbols from all
object files will be reconstructed with the ranlib command.

        My questions:

        Is a non-shared library just an object file?
        If I understood well 'ar' + 'ranlib' = merge of object files and the
result is probably just
an object file. If so, why the extension is changed from *.o to *.a ?

        If they are not the same, then what is the difference between an
object file and a library ?

        Secondly:
        Why is 'ar' better for this job than 'tar' ? I suspect that the
reason is the 'ranlib' program
which can only understand the format of 'ar'. Is there any other
reason ?

        Third and last:))
        With 'ar' I can delete objects files from the library. If that
happens do I have to run
ranlib again on the library ?

        Thanks to all gurus for looking at such a simple questions.

Best regards,
Razvan



Relevant Pages

  • Re: Question about libraries and object files!
    ... >As I read from the manual called "Developping software ... >files will be reconstructed with the ranlib command. ... It is a library of object files saved into one single file. ... which can retrieve individual modules from the libraries ...
    (comp.os.linux.development.apps)
  • Cannot activate incremental link - please help
    ... dozen of libraries and object files of different sizes - from less than 1Mb to ... And this is the reason I've got: ... The funny thing is that link options DID NOT change. ...
    (microsoft.public.dotnet.languages.vc)
  • Why compiling kernel needs linux softlink
    ... a lot of disk space for object files like *.o. ... For this reason the ... /usr/src/linuc MUST be a soft link pointing to your source directory." ...
    (comp.os.linux.misc)
  • Re: CC /MMS_DEPENDENCIES and related difficulties
    ... >> I never did have a good reason to put object files in a separate ... My separate directories ... > object files by version numbers, and more convenient than using file ...
    (comp.os.vms)