Jouko Kivilahti [EMAIL PROTECTED] 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,
Jouko Kivilahti [EMAIL PROTECTED] 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,
Package: libc6-dev
Version: 2.3.1-3
Severity: important
Using pow(x,y); at source does not compile
-- a.c
#include stdio.h
#include math.h
int main()
{
int a;
a = pow(2,2);
printf(%d\n,a);
return (0);
}
--
$ gcc a.c
/tmp/cc2ik7lo.o(.text+0x1f): In function `main':
: undefined
3 matches
Mail list logo