473,587 Members | 2,580 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(.tex t+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 6555
"Matthias Pfeifer" <pf****@web.d e> wrote in message
news:opsb0nat0c 9w4rct@localhos t...
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(.tex t+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************ ***********@YOU RBRAnoos.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(.tex t+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
2622
by: Jone Smide | last post by:
Is there a way to calculate a cos and a sin in J2ME MIDP 1.0?
7
4877
by: franky.backeljauw | last post by:
Hello, I have the following code: <code> class X { ___ sin(); } X sin( X ) { return sin( y, x ); }
14
3145
by: Alexander Stippler | last post by:
Hi, simple question. Why does this not work: #include <algorithm> #include <cmath> #include <iostream> int main()
5
3972
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 smoother. How do I get the program to calculate that? I thought of using a counter to count through until it gets to the number of user chosen lines...
0
2700
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 ,example sin graph in window form but i must give the commands in console application ?
0
4107
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 SIN/COS/TAN, etc without the use of CMATH. Using two recursive functions for the power and factorial. Gotta do some other things as well, but right now I'm just...
70
7322
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
1213
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 play the file with the inverted Sin (example, if the record is a wave that starts from the origin of an hipotetic cartesian plane, I have to create a...
318
10910
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 ... http://kingrazi.blogspot.com/2008/05/shootout-c-net-vs-java-benchmarks.html Just to keep the post on topic for my friends at comp.lang.c++, how do I play default windows...
3
6895
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 <sys/types.h> #include <sys/socket.h> int main(){
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.