<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
static	B-Library
library	I-Library
or	O
statically-linked	O
library	O
is	O
a	O
set	O
of	O
routines	O
,	O
external	O
functions	O
and	O
variables	O
which	O
are	O
resolved	O
in	O
a	O
caller	O
at	O
compile-time	B-Application
and	O
copied	O
into	O
a	O
target	O
application	O
by	O
a	O
compiler	B-Language
,	O
linker	B-Application
,	O
or	O
binder	O
,	O
producing	O
an	O
object	B-Application
file	I-Application
and	O
a	O
stand-alone	B-General_Concept
executable	B-Application
.	O
</s>
<s>
This	O
executable	B-Application
and	O
the	O
process	O
of	O
compiling	B-Language
it	O
are	O
both	O
known	O
as	O
a	O
static	B-Application
build	I-Application
of	O
the	O
program	O
.	O
</s>
<s>
Static	B-Library
libraries	I-Library
are	O
either	O
merged	O
with	O
other	O
static	B-Library
libraries	I-Library
and	O
object	B-Application
files	I-Application
during	O
building/linking	O
to	O
form	O
a	O
single	O
executable	B-Application
or	O
loaded	O
at	O
run-time	B-Library
into	O
the	O
address	B-General_Concept
space	I-General_Concept
of	O
their	O
corresponding	O
executable	B-Application
at	O
a	O
static	B-General_Concept
memory	I-General_Concept
offset	I-General_Concept
determined	O
at	O
compile-time/link	O
-time	O
.	O
</s>
<s>
There	O
are	O
several	O
advantages	O
to	O
statically	O
linking	B-Application
libraries	O
with	O
an	O
executable	B-Application
instead	O
of	O
dynamically	B-Application
linking	I-Application
them	O
.	O
</s>
<s>
This	O
avoids	O
dependency	O
problems	O
,	O
known	O
colloquially	O
as	O
DLL	O
Hell	O
or	O
more	O
generally	O
dependency	B-Protocol
hell	I-Protocol
.	O
</s>
<s>
Static	B-Library
linking	I-Library
can	O
also	O
allow	O
the	O
application	O
to	O
be	O
contained	O
in	O
a	O
single	O
executable	B-Application
file	I-Application
,	O
simplifying	O
distribution	O
and	O
installation	O
.	O
</s>
<s>
With	O
static	B-Library
linking	I-Library
,	O
it	O
is	O
enough	O
to	O
include	O
those	O
parts	O
of	O
the	O
library	O
that	O
are	O
directly	O
and	O
indirectly	O
referenced	O
by	O
the	O
target	O
executable	B-Application
(	O
or	O
target	O
library	O
)	O
.	O
</s>
<s>
With	O
dynamic	B-Application
libraries	I-Application
,	O
the	O
entire	O
library	O
is	O
loaded	O
,	O
as	O
it	O
is	O
not	O
known	O
in	O
advance	O
which	O
functions	O
will	O
be	O
invoked	O
by	O
applications	O
.	O
</s>
<s>
In	O
static	B-Library
linking	I-Library
,	O
the	O
size	O
of	O
the	O
executable	B-Application
becomes	O
greater	O
than	O
in	O
dynamic	B-Application
linking	I-Application
,	O
as	O
the	O
library	O
code	O
is	O
stored	O
within	O
the	O
executable	B-Application
rather	O
than	O
in	O
separate	O
files	O
.	O
</s>
<s>
But	O
if	O
library	O
files	O
are	O
counted	O
as	O
part	O
of	O
the	O
application	O
then	O
the	O
total	O
size	O
will	O
be	O
similar	O
,	O
or	O
even	O
smaller	O
if	O
the	O
compiler	B-Language
eliminates	O
the	O
unused	O
symbols	O
.	O
</s>
<s>
On	O
Microsoft	B-Application
Windows	I-Application
it	O
is	O
common	O
to	O
include	O
the	O
library	O
files	O
an	O
application	O
needs	O
with	O
the	O
application	O
.	O
</s>
<s>
On	O
Unix-like	B-Operating_System
systems	I-Operating_System
this	O
is	O
less	O
common	O
as	O
package	B-Application
management	I-Application
systems	I-Application
can	O
be	O
used	O
to	O
ensure	O
the	O
correct	O
library	O
files	O
are	O
available	O
.	O
</s>
<s>
In	O
practice	O
,	O
many	O
executables	B-Application
(	O
especially	O
those	O
targeting	O
Microsoft	B-Application
Windows	I-Application
)	O
use	O
both	O
static	O
and	O
dynamic	B-Application
libraries	I-Application
.	O
</s>
<s>
Any	O
static	B-Library
library	I-Library
function	O
can	O
call	O
a	O
function	O
or	O
procedure	O
in	O
another	O
static	B-Library
library	I-Library
.	O
</s>
<s>
The	O
linker	B-Application
and	O
loader	B-Operating_System
handle	O
this	O
the	O
same	O
way	O
as	O
for	O
kinds	O
of	O
other	O
object	B-Application
files	I-Application
.	O
</s>
<s>
Static	B-Library
library	I-Library
files	O
may	O
be	O
linked	O
at	O
run	B-Library
time	I-Library
by	O
a	O
linking	B-Application
loader	I-Application
(	O
e.g.	O
,	O
the	O
X11	B-Operating_System
module	O
loader	B-Operating_System
)	O
.	O
</s>
<s>
However	O
,	O
whether	O
such	O
a	O
process	O
can	O
be	O
called	O
static	B-Library
linking	I-Library
is	O
controversial	O
.	O
</s>
<s>
Static	B-Library
libraries	I-Library
can	O
be	O
easily	O
created	O
in	O
C	B-Language
or	O
in	O
C++	B-Language
.	O
</s>
<s>
These	O
two	O
languages	O
provide	O
storage-class	O
specifiers	O
for	O
indicating	O
external	O
or	O
internal	B-Language
linkage	I-Language
,	O
in	O
addition	O
to	O
providing	O
other	O
features	O
.	O
</s>
<s>
To	O
create	O
such	O
a	O
library	O
,	O
the	O
exported	O
functions/procedures	O
and	O
other	O
objects	O
variables	O
must	O
be	O
specified	O
for	O
external	B-Language
linkage	I-Language
(	O
i.e.	O
</s>
<s>
by	O
not	O
using	O
the	O
C	B-Language
static	O
keyword	O
)	O
.	O
</s>
<s>
Static	B-Library
library	I-Library
filenames	O
usually	O
have	O
""	O
extension	O
on	O
Unix-like	B-Operating_System
systems	I-Operating_System
and	O
""	O
extension	O
on	O
Microsoft	B-Application
Windows	I-Application
.	O
</s>
<s>
For	O
example	O
,	O
on	O
a	O
Unix-like	B-Operating_System
system	I-Operating_System
,	O
to	O
create	O
an	O
archive	O
named	O
from	O
files	O
,	O
,	O
,	O
the	O
following	O
command	O
would	O
be	O
used	O
:	O
</s>
<s>
to	O
compile	B-Language
a	O
program	O
that	O
depends	O
on	O
,	O
,	O
and	O
,	O
one	O
could	O
do	O
:	O
</s>
