Philip S Tellis forced the electrons to say:
> I cannot compile (link actually) any program that has functions from
> math.h

As a hangover from the old days, the mathematical functions were put in
a separate library which was never linked by default with the program
being compiled. You have to tell the compiler to link the mathematics
library. On Unix, the command line switch -lm (link the math library)
will do the trick.

So, to compile, use

gcc prog.c -lm

or, put in the Makefile,

LDFLAGS += -lm

Binand

-- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!

To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list 
button and fill the appropriate information 
and submit. For any other queries contact the ML maintener

Reply via email to