osmium <r1********@comcast.net> wrote:
"dan" writes:
Hi I am teaching myself how to program in c. Iam woundering where i
can find a list of gnu c libarey functions. some day i will learn to
spell. I am running freebsd as an op system would the gnu c libeary
functions be stored in one of its diredtorys. I am espically haveing
trouble the pow function to work. I am trying to program that computes
the value of a capicators capasitive reactance. I worked on trying to
get the POW function for more than 4 hours at a time .
I would expect this to work on any C compiler.
#inclue <math.h>
double x;
x = pow(2.0, 16.0);
Note that it is pow and not POW
The math library is called libm.so (somewhere in a <prefix>/lib
directory). Although proper code containing your lines, may
compile fine, it will not link because it requires you to
tell it where the math library is.
With gcc you can do:
gcc <...other stuff ...> program.c -lm
-lm tells the linker to links against l(ib)m.so
At the same time, maybe the OP's math library is not separate from
the C library and he may not need to do that, but he probably
does.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)