linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Colannino <james@colannino.org>
To: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: Undefined reference to 'fmod'
Date: Sun, 11 Jun 2006 10:58:18 -0700	[thread overview]
Message-ID: <448C59BA.2090706@colannino.org> (raw)
In-Reply-To: <17547.46674.360830.637227@cerise.gclements.plus.com>

Glynn Clements wrote:

> No, fmod() is in libm, so you have to add -lm to the link command.
> 
> As a general rule, anything which uses <math.h> has to link against
> libm.

Interesting.  Compiling with the argument -lm fixed my problem.  That
leads me to another question: why are the functions found in math.h in a
separate library?  I would have thought that all functions found in the
standard C library would be in glibc (The K&R book I'm reading said that
math.h is a part of the standard library.)

James
-- 
My blog: http://www.crazydrclaw.com/
My homepage: http://james.colannino.org/

"Blessed is the man, who having nothing to say, abstains from giving
wordy evidence of the fact." --George Eliot

  parent reply	other threads:[~2006-06-11 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-11  4:35 Undefined reference to 'fmod' James Colannino
2006-06-11  7:17 ` Steve Graegert
2006-06-11  7:18 ` Glynn Clements
     [not found] ` <17547.46674.360830.637227@cerise.gclements.plus.com>
2006-06-11 17:58   ` James Colannino [this message]
2006-06-11 19:20     ` Steve Graegert
2006-06-14 15:41     ` James Stevenson
2006-06-15  0:20       ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=448C59BA.2090706@colannino.org \
    --to=james@colannino.org \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).