public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: llewelly@198.dsl.xmission.com
To: "Jose Miguel A.C.Pires" <jmcp@ci.uminho.pt>
Cc: help-gcc@gnu.org
Subject: Re: Compilation error
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.10.10002211136090.5368-100000@198.dsl.xmission.com> (raw)
Message-ID: <20000401000000.__Zl0YZlmp_SV8MJBzW1FtEh8r1no2kYsaLKntz7arw@z> (raw)
In-Reply-To: <200002211831.SAA15847@pessoa.ci.uminho.pt>

On Mon, 21 Feb 2000, Jose Miguel A.C.Pires wrote:

> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hello
> 
> I'm trying to compile this simple program
> 
> #include <stdio.h>
> #include <math.h>
> 
> int main(void)
> {
>   float r=2;
> 
>   printf("A raiz de %2.0f e' %.6f", r, sqrt(r));
> 
>   return 0;
> }
> 
> but i get the following errors.
> 
> /tmp/cca110161.o: In function `main':
> /tmp/cca110161.o(.text+0x17): undefined reference to `sqrt'
> 

Add -lm to your link line:

$gcc foo.c -lm

(-lm means 'link libm.[so,a] . libm is the math library.')

  reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-21 10:27 Jose Miguel A.C.Pires
2000-02-21 10:39 ` llewelly [this message]
2000-04-01  0:00   ` llewelly
2000-04-01  0:00 ` Jose Miguel A.C.Pires
2005-07-18  4:24 Oleg Kotsyurbiy
2005-07-18  5:51 ` Ian Lance Taylor
2005-07-18  7:45   ` Arturas Moskvinas
2006-10-07 18:58 compilation error ranjith kumar
2006-10-07 19:36 ` Tim Prince
2011-06-08 12:25 Rony Paul
2011-06-08 13:31 ` Jonathan Wakely
2011-06-08 13:47 ` Ian Lance Taylor
2012-08-15 15:43 Configuration Error Jonathan Wakely
2012-08-15 17:49 ` B B
2012-08-15 17:57   ` Jonathan Wakely
2012-08-15 18:03     ` Compilation Error Ron Stubbs
2012-08-15 18:14       ` Marc Glisse
2012-08-15 18:46       ` B B
     [not found]         ` <CAH6eHdRV5NLCO-+iJw1FHqw+6EV-LSCNkhF-SJ0jZUPtdbwFKQ@mail.gmail.com>
2012-08-15 19:25           ` Jonathan Wakely
2012-08-15 19:36     ` Ron Stubbs
2012-08-16  3:59       ` Marc Glisse
2012-08-16 13:29         ` Ron Stubbs
2012-08-16 15:15           ` Tim Prince
2012-08-16 20:06           ` Marc Glisse
2012-08-17  0:12             ` Ron Stubbs
2012-08-17  7:23               ` Marc Glisse
2012-08-17  8:23                 ` Jonathan Wakely

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=Pine.LNX.4.10.10002211136090.5368-100000@198.dsl.xmission.com \
    --to=llewelly@198.dsl.xmission.com \
    --cc=help-gcc@gnu.org \
    --cc=jmcp@ci.uminho.pt \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).