On 3/05/2008, at 6:21 PM, Richard Toohey wrote:
On 3/05/2008, at 6:18 PM, Ben Calvert wrote:
I'm sure i'm doing something really basic and stupid here, but i
can't seem to use pow() from math.h ???
ben:2$ cc test_pow.c
/tmp//ccy24322.o(.text+0x31): In function `main':
: undefined reference to `pow'
collect2: ld returned 1 exit status
ben:3$
I think you need to link to the maths lib?
Yep ...
$ cc test_pow.c
/tmp//ccZh4243.o(.text+0x31): In function `main':
: undefined reference to `pow'
collect2: ld returned 1 exit status
$ cc -lm test_pow.c
$