Re: C compiler.
"paul" <paul@redhotants.com> writes:
> i'm trying to compile (gcc filename.c) the following program, but it seems
> math.h isn't being found.
The header file math.h is found. But the _function definitions_, which
are part of the libc, are not found:
[...]
> /tmp/ccCw1SMR.o(.text+0x52): undefined reference to `pow'
> collect2: ld returned 1 exit status
[...]
...so, linking fails. You've to explicitely tell gcc to link against
the math library with the '-lm' switch.
moritz
--
Moritz Schulte <moritz@chaosdorf.de> http://www.chaosdorf.de/moritz/
Debian/GNU supporter - http://www.debian.org/ http://www.gnu.org/
GPG fingerprint = 3A14 3923 15BE FD57 FC06 B501 0841 2D7B 6F98 4199
Reply to: