Re: Problem using math library

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

 



On Wed, 17 Dec 2003, Tom Tran wrote:

> gcc gave this error: undefined reference pow

> I tried other functions s.a. sqrt(), sin(), etc.  Same problem.
> Other header files (s.a. <stdio.h> <string.h> <stdlib.h> work fine.

Math library will not be linked by default. Link it by -lm option.

gcc myprg.c -lm

Bye :)
-- 
Bharathi S, IndLinuX Team,   (__)
DON Lab,    TeNeT Group,     oo )
IIT-Madras, Chennai-INDIA.   (_/\ 

Known is drop, Unknown is OCEAN.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux