public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: -lm not required when including functions from math.h
@ 2008-06-27 17:38 Harvey Muller
  0 siblings, 0 replies; 3+ messages in thread
From: Harvey Muller @ 2008-06-27 17:38 UTC (permalink / raw)
  To: Eljay Love-Jensen, GCC-help

Eljay,

That helped enormously, thanks for the pointer.  They are indeed built into the
compiler.  Now I know to use -fno-builtin and -lm if I specifically want to use libm.a,
and more importantly, why.

Best regards,

Harvey

----- Original Message ----
> From: Eljay Love-Jensen <eljay@adobe.com>
> To: Harvey Muller <hlmuller@yahoo.com>; GCC-help <gcc-help@gcc.gnu.org>
> Sent: Friday, June 27, 2008 1:06:32 PM
> Subject: Re: -lm not required when including functions from math.h
> 
> Hi Harvey,
> 
> Some math functions are built into the compiler.
> 
> Some math functions are macros in the math.h header.
> 
> Some platforms include -lm (or the analogous equivalent) for you.
> 
> HTH,
> --Eljay

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -lm not required when including functions from math.h
  2008-06-27 17:04 Harvey Muller
@ 2008-06-27 17:07 ` Eljay Love-Jensen
  0 siblings, 0 replies; 3+ messages in thread
From: Eljay Love-Jensen @ 2008-06-27 17:07 UTC (permalink / raw)
  To: Harvey Muller, GCC-help

Hi Harvey,

Some math functions are built into the compiler.

Some math functions are macros in the math.h header.

Some platforms include -lm (or the analogous equivalent) for you.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 3+ messages in thread

* -lm not required when including functions from math.h
@ 2008-06-27 17:04 Harvey Muller
  2008-06-27 17:07 ` Eljay Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Harvey Muller @ 2008-06-27 17:04 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-27 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-27 17:38 -lm not required when including functions from math.h Harvey Muller
  -- strict thread matches above, loose matches on Subject: below --
2008-06-27 17:04 Harvey Muller
2008-06-27 17:07 ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).