473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sin-function from math.h not available

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.
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
Nov 14 '05 #1
4 6552
"Matthias Pfeifer" <pf****@web.de> wrote in message
news:opsb0nat0c9w4rct@localhost...
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;
}


http://www.eskimo.com/~scs/C-faq/q14.3.html

Alex
Nov 14 '05 #2
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.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

"C is a sharp tool"

Nov 14 '05 #3
(supersedes <mn***********************@YOURBRAnoos.fr>)

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.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

"C is a sharp tool"

Nov 14 '05 #4
Matthias Pfeifer wrote:
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.
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2617
by: Jone Smide | last post by:
Is there a way to calculate a cos and a sin in J2ME MIDP 1.0?
7
4869
by: franky.backeljauw | last post by:
Hello, I have the following code: <code> class X { ___ sin(); } X sin( X ) { return sin( y, x ); }
14
3131
by: Alexander Stippler | last post by:
Hi, simple question. Why does this not work: #include <algorithm> #include <cmath> #include <iostream> int main()
5
3965
by: reagan | last post by:
I am trying to get a program(in visual C++) to draw a sine curve (from 0 to 2pi). It takes 8 lines to draw the complete curve. However, the user can choose to use up to 100 lines to make the curve...
0
2697
by: suedasszyy | last post by:
Haiiii.... i'm new for VB.net. can someone help me to solve those question? is it possible to draw a graph such as Sin graph using console application? if not, how can i draw a graph...
0
4101
by: outofstep | last post by:
Hit me up on AIM/YIM (oipaloi). I'm not a code monkey and would like to get some advice. Or hit up this thread right here. I'm using DEV C++ as my compiler. I'm trying to calculate...
70
7283
by: Adam | last post by:
Hi, I am using the following code: printf("%g", sin(M_PI)) and getting 1.22461e-16 instead of zero. Does anyone have any idea why, and what I can do about it? Thanks, Adam
0
1208
luke14free
by: luke14free | last post by:
Hello, I'm doing a project for a physics project and having some problem doing it. What I exactly need to do is to gain some audio from a microphone, analyze it and take its wave. Then i'd have to...
318
10745
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
3
6884
by: mariab | last post by:
hi, i'm having the problem with my first socket program...i have been staring at it for an hour but i cant find whats wrong with it...can u check it out pls? #include <stdio.h> #include...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.