linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Smith <sos22@cam.ac.uk>
To: linux-c-programming@vger.kernel.org
Subject: Re: undefined sqrt()
Date: Thu, 24 Oct 2002 21:28:47 +0100	[thread overview]
Message-ID: <20021024202847.GA11866@cam.ac.uk> (raw)
In-Reply-To: <20021024200624.GA1057@teamfinders.org>

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

> When I try to compile it, I get these messages:
> 
> dragoon:/home/tschulze/bin # gcc -Wall -o glide glide.c
> /tmp/ccXahjXY.o: In function `main':
> /tmp/ccXahjXY.o(.text+0x98): undefined reference to `sqrt'
> collect2: ld returned 1 exit status
> 
> Could someone please give me a hint why this doesn't work?
You need to link with the maths library.  Try this:

gcc -Wall -o glide glide.c -lm

Steven Smith,
sos22@cam.ac.uk.

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  parent reply	other threads:[~2002-10-24 20:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-24 20:06 undefined sqrt() Theo. Sean Schulze
2002-10-24 20:17 ` Karthik Vishwanath
2002-10-24 20:50   ` Theo. Sean Schulze
2002-10-24 21:50     ` Karthik Vishwanath
2002-10-25  8:17     ` Glynn Clements
2002-10-25 17:27       ` Theo. Sean Schulze
2002-10-25 19:29         ` Glynn Clements
2002-10-24 20:28 ` Steven Smith [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-26 10:07 Ruslan U. Zakirov

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=20021024202847.GA11866@cam.ac.uk \
    --to=sos22@cam.ac.uk \
    --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).