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?
http://www.openbsd.org/cgi-bin/man.cgi?
query=math&sektion=3&arch=i386&apropos=0&manpath=OpenBSD+Current
The link editor searches this library under the ``-lm'' option.
Declarations for these
functions may be obtained from the include file <math.h>.