-lm not required when including functions from math.h

Harvey Muller hlmuller@yahoo.com
Fri Jun 27 17:04:00 GMT 2008


I'm learning C programming using the GNU toolchain (gcc, as, ld, glibc) using a popular linux distribution.  What I expect from what I have read so far, is that if I use a function from the math library without specifying the library on the gcc, command line, is that I should get an "undefined reference" error message.
I am not getting the expected error message, the simple application compiles and executes correctly.  Can anyone explain why I am not getting the expected error message?
Best regards,
Harvey



More information about the Gcc-help mailing list