www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/14/03:48:05

Date: Sun, 14 Jan 96 01:32:01 MST
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: enoch AT terranet DOT terranet DOT ab DOT ca (Peter Plum)
Subject: Peter: again!! Undefined reference to 'sin' this time.

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

- Raw text -


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