Re: I can't seem to use pow()
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 06 Apr 2006 00:30:43 GMT
Joe Wright <joewwright@xxxxxxxxxxx> writes:
Mark Healey wrote:
I'm using gcc on a fedora 3 system here are what I think the relevantYou haven't linked in the math library. That makes you new to C. Being
lines are:
#include <math.h>
[a bunch of stuff snipped]
r=pow(2,z);
When I compile I get /tmp/ccg0U2N1.o(.text+0xd9): In function
`generateMap':
: undefined reference to `pow'
collect2: ld returned 1 exit status
Why is this?
that new, how did you find this newsgroup?
Or he's been using compilers that link the math library without being
told to do so. Or he hasn't been using <math.h> until recently.
Please, before you post again, read the stuff at..
http://c-faq.com
To be fair, that particular question can be difficult to find unless
you already know about it. The question refers to "sin" and "cos",
not to "pow". (On the other hand, it also refers to <math.h>, and
it's in the section on floating point, so it's not *completely*
hidden.)
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- I can't seem to use pow()
- From: Mark Healey
- Re: I can't seem to use pow()
- From: Joe Wright
- I can't seem to use pow()
- Prev by Date: Re: Reading a Text file
- Next by Date: Re: getchar() behaviour on gcc 4.1
- Previous by thread: Re: I can't seem to use pow()
- Next by thread: Re: I can't seem to use pow()
- Index(es):
Relevant Pages
|
|