The following simple test program produces the attached "undefined
reference to `sin'" diagnostic message. I am using Red Hat 5.1 Linux.
This trig function is the only difficulty that I am experiencing in my
development.
It looks to me like I am either required to include file include an
include file in addition to the <math.h>. However, this is not required
on other UNIX systems. The man page for 'sin' does not specify an
include file in addition to the <math.h> file which I have included.
It certainly looks like a prototype issue. Am I missing something
obvious here? Your comments by e-mail are appreciated.
Regards, W. John Gammage
--------=[ begin code and diagnostic excerpt here ]=--------
jgammage /Users/jgammage/Programs/Hack ! ;) make math
cc math.c -o math
/tmp/cca003491.o: In function `main':
/tmp/cca003491.o(.text+0xe): undefined reference to `sin'
make: *** [math] Error 1
Test program:
#include <math.h>
double d_Scale;
main () {
d_Scale = sin( M_PI );
--------=[ end code and diagnostic excerpt here ]=--------Quote:}