In message <vj************@corp.supernews.com>
Derk Gwen <de******@HotPOP.com> wrote:
"John B." <j1**@yahoo.com> wrote:
# I'm self teaching myself C on a Linux box but I can't get a simple
# program to recognize math functions. I start the program with:
It compiles but has link errors? On most platform, you have to link the
math library. On unices this is done with a -lm on the ld command (or *cc
command used to call ld).
I've never quite understood why this is. Presumably it has something to
do with reducing code size, but are Unix linkers not sophisticated enough to
omit unused portions of libraries automatically?
Surely a modern Unix C environment could default to including the whole ISO C
library and omit the portions not required?
--
Kevin Bracey, Principal Software Engineer
Tematic Ltd Tel: +44 (0) 1223 503464
182-190 Newmarket Road Fax: +44 (0) 1223 503458
Cambridge, CB5 8HE, United Kingdom WWW:
http://www.tematic.com/