insert #include <cmath> or <math.h> depending on what language your using
Thanks, Tyler Littlefield email: [EMAIL PROTECTED] web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005 ----- Original Message ----- From: frank zhu To: [email protected] Sent: Thursday, October 30, 2008 7:42 PM Subject: [c-prog] Re: That new guy needs help! Hi, Same here, I got the following error: math1.c:(.text+0x5c): undefined reference to `pow' Refer to C library, double pow(double, double) is a library function. I don't know why pow is not resolved. I am using ubuntu hardy on amd64. anyone know why? Frank, ============ #include <stdio.h> #include <math.h> int main() { double x,y,z; x=64.0; y=3.0; z=0.5; printf("pow( 64.0,3.0) returns: %7.0f\n", pow(x,y)); printf("sqrt( 64.0) returns: %2.0f\n", sqrt(64.0)) ; // I assume you have a typo printf("pow( 64.0,0.5) returns: %2.0f\n", pow(x,z)); return 0; } =============== [Non-text portions of this message have been removed]
