where to find functions libariey

D

dan

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 . Thanks for your
input. dan
 
O

osmium

dan said:
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
 
N

Nelu

osmium said:
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.
 
J

Jordan Abel

dan said:
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 . Thanks for
your input. dan

Why do you want the GNU library in freebsd? What do you want that the
FreeBSD C library isn't providing? (OT: If your problem is that the math
functions like pow aren't working, don't forget -lm on the link command
line)
 
D

dan

VDM said:
Hi Dan,

Have a look at this, http://www.gnu.org/software/libc/manual/
It covers everything.

If you have the man pages installed (think it is by default for glibc)
then try typing man pow in a terminal.

Have fun!

talking about me being stupid why dident i think of the man page.
talking about how green I m I didnot asign the pow function to a
varable so I could work with the output of pow. Thanks for all the info
it really helped........dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top