[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#166543: libc6-dev: using GCC pow(x,y); does not compile.

Jouko Kivilahti <azul@linux.lan> writes:

> Using pow(x,y); at source does not compile

But it does!

> $ gcc a.c
> /tmp/cc2ik7lo.o(.text+0x1f): In function `main':
> : undefined reference to `pow'
> collect2: ld returned 1 exit status

This is a linker error message.  You have to link against libm, by
invoking gcc with the "-lm" parameter.

Florian Weimer 	                  Weimer@CERT.Uni-Stuttgart.DE
University of Stuttgart           http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT                          fax +49-711-685-5898

Reply to: