gcc 2.95.3 linker problems

Eljay Love-Jensen eljay@adobe.com
Sat Sep 13 14:31:00 GMT 2003


Hi Jakob,

GCC does not normally include the math LIBRARY (libm.a or libm.so), even if you've included the math HEADER (math.h).  This practice is fairly common amonst compiler vendors, so GCC is not doing something wonky or strange.

You have to include the math LIBRARY by putting -lm (dash ell em) on your GCC link or compile+link line.

e.g.:
gcc -o myfoo foo.c -lm

HTH,
--Eljay




More information about the Gcc-help mailing list