[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: what is the difference between shared and static libraries



With a shared library only one copy of the library is loaded into the memory. A static library is like any or your .o files which you link together to form a binary , an exe or infact a shared library or another static library.
So when  u link to a static library it actually is copied into ur program. If N programs use the static lib, so many copies of it are loaded into memory.

an archive is nothing but a collection of .o s ofcouse to get an archive u have to compile the sources, naturally. And libraries do not contain main.
Hari

P. Hari Krishna,
Software Engineer,
Net Technology Services Group,
Novell Product Group, Bangalore, India
Phone: 91 - 80 - 5721856/58; Ext: 2033
Novell, Inc., the leading provider of Net services software
www.novell.com 


>>> ramesh_tnj@xxxxxxxxx 11/16/00 09:46AM >>>
hi all,

can anybody explain me the difference between the shared and static
libraries.. both are going to be included before executoion..
but even static libraries are also shared among rprograms know then why
specifically two names are given.. i am not clear in this hting..

also if i am writing a fucntion for converting a long value to  a string
how to make is as a library... i heard that we can use
ar archive.. but we have to compile it before or what.. if compiling means
it should contain main().. then how can other program cna use that
library..
can anybody explain me from scratch.. i am very much interested in having
my own libraries.. help me..

ramesh


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com 


---------------------------------------------
Find out more about this and other Linux India
mailing lists at http://lists.linux-india.org/