sin-function from math.h not available

M

Matthias Pfeifer

hi group,

i realy wonder if there is a sin(double) function defined in math.h since
i have problems compiling the following small programm:

/* sinus.c example code */

#include<math.h>

int main(int argc, char* argv[])
{
sin(1.2);
return 0;
}

compiler is gcc-Version 3.3.4 (Debian 1:3.3.4-3) and compilation gives:
matthias@euler:~/src$ gcc -o sinus sinus.c
/tmp/ccqsY2qP.o(.text+0x1a): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status

thank you all.
 
E

Emmanuel Delahaye

Matthias Pfeifer wrote on 31/07/04 :
i realy wonder if there is a sin(double) function defined in math.h since i
have problems compiling the following small programm:
compiler is gcc-Version 3.3.4 (Debian 1:3.3.4-3) and compilation gives:
matthias@euler:~/src$ gcc -o sinus sinus.c
/tmp/ccqsY2qP.o(.text+0x1a): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status

Yes. Please read the FAQ. You have a linker problem (missing library).

Please note that the is no function defined in <math.h>. It only
containts the functions prototypes.
 
E

Emmanuel Delahaye

(supersedes <[email protected]>)

Matthias Pfeifer wrote on 31/07/04 :
i realy wonder if there is a sin(double) function defined in math.h since
i have problems compiling the following small programm:
compiler is gcc-Version 3.3.4 (Debian 1:3.3.4-3) and compilation gives:
matthias@euler:~/src$ gcc -o sinus sinus.c
/tmp/ccqsY2qP.o(.text+0x1a): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status

Yes. Please read the FAQ. You have a linker problem (missing library).

Please note that there is no function defined in <math.h>. It only
containts the functions prototypes.
 
M

Martin Ambuhl

Matthias said:
hi group,

i realy wonder if there is a sin(double) function defined in math.h
since i have problems compiling the following small programm:

Of course there is. And your question is well answered in the FAQ, the
checking of which is normal for civilized folk. And don't bother crying
that you don't know where the FAQ is. Expected usenet behavior is to
lurk in a group before posting or at least to check the archives. Had
you done that, you would have seen not only references to the FAQ
location but the FAQ itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top