How to use sqrtf in gcc?

S Bharathi bharathi@lantana.tenet.res.in
Tue Jan 29 20:49:00 GMT 2002


On Wed, 30 Jan 2002, Thai Dang Vu wrote:

> I cannot use sqrt or sqrtf functions in gcc.
> I can link the above program, but cannot build it. I received a message
> that there was no referrence to sqrtf on building it.

Add -lm option during linking
( -lm === MATH_LIBRARY )

   cc foo.o -o foo -lm

Regards,
Bharathi S.



More information about the Gcc-help mailing list