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

Re: Where is C 'pow' function?



On Mon, Nov 20, 2000 at 11:44:39AM -0700, Matt Miller wrote:
> The following C program:
> 
> 	#include <math.h>
> 
> 	int main ()
> 	{
> 	  double p = pow (2, 3);
> 	  return 0;
> 	}
> 
> fails to link.  ld issues the following complaint:
> 
> 	undefined reference to `pow'

guess?! math!

you've to link with -lm (libm).

-- 
   Johannes



Reply to: