Ciko wrote On 02/21/06 11:12,:
Still not clear to me: why whe use <stdio.h> I haven't link stdio
library (in linking stage) while if I use something of <math.h> I must
link this library? Thanks in advance.
It's an accident of history. All but a tiny minority
of C programs need at least some parts of the C library,
so the "base" library is automatically included in the link
(on most systems). However, only a few programs use the
mathematical functions, so many systems place them in a
separate library that is linked only if requested. In the
days when computers were small and disks were slow, one
could save a noticeable amount of time by not making the
linker process libraries that the program wouldn't need.
I emphasize that all this is system-specific. Some
systems do not segment the library in this manner, but
instead automatically link an "omnibus" library containing
all the Standard functions (often non-Standard functions,
too). Even among the systems where separate libraries have
been traditional there seems to be a movement towards a
single library. The need for "-lm" or "/LIB=LIBMATH" or
whatever may eventually dwindle away.