delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/15/09:22:17

From: kagel AT quasar DOT bloomberg DOT com
Date: Mon, 15 Jan 1996 09:02:03 -0500
To: enoch AT terranet DOT terranet DOT ab DOT ca
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Peter: again!! Undefined reference to 'sin' this time.
Reply-To: kagel AT quasar DOT bloomberg DOT com

   Errors-To: postmaster AT ns1
   Date: Sun, 14 Jan 96 01:32:01 MST
   X-Sender: enoch AT terranet DOT terranet DOT ab DOT ca
   X-Mailer: Windows Eudora Version 1.4.4
   Mime-Version: 1.0
   From: enoch AT terranet DOT terranet DOT ab DOT ca (Peter Plum)
   Content-Type: text/plain; charset="us-ascii"
   Content-Length: 738

   Here we go again!  I get this message:

   GNU C++ Compile: SINE.c -lpc
   SINE.c(.text+0x32): undefined reference to `sin'

   ... when I compile this program:

   #include <math.h>
   #include <stdio.h>
   main ()
   {
   float d = 40.05;
   float n ;
   n = sin( d ) ;
   printf("The sine of %f is %f", d, n);
   return(0);
   }

   ...I even tried using -lmath in the command line.
   Why Oh why does this happen?  Doesn't
   "#include <math.h>" define a reference to 'sin'?
   TC Lite handles it just fine.
   Thanks again for the help.
   "In Him was life, and His life is the light of men
   He came unto His own but His own received Him not
   but He gave power to as many as would receive Him
   to become the sons of God!"
   Peter Plum
   RR1 Site10 Box 10
   Grande Prairie. AB 
   T8V 2Z8
   403 538 4713


The compile line S/B:

gcc SINE.c -lm

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019