Bug#166543: libc6-dev: using GCC pow(x,y); does not compile.
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, by invoking gcc with the -lm parameter. -- Florian Weimer[EMAIL PROTECTED] University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/ RUS-CERT fax +49-711-685-5898 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#166543: libc6-dev: using GCC pow(x,y); does not compile.
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, by invoking gcc with the -lm parameter. -- Florian Weimer[EMAIL PROTECTED] University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/ RUS-CERT fax +49-711-685-5898
Bug#166543: libc6-dev: using GCC pow(x,y); does not compile.
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 reference to `pow' collect2: ld returned 1 exit status it does compile with other (mingw32, other-os-compilers) compilers. -- System Information Debian Release: testing/unstable Kernel Version: Linux linux.lan 2.4.18-386 #2 Sun Apr 14 10:38:08 EST 2002 i586 Pentium 75 - 200 GenuineIntel GNU/Linux Versions of the packages libc6-dev depends on: ii libc6 2.3.1-3GNU C Library: Shared libraries and Timezone -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]