# what does this error mean ?

Discussion in 'C' started by raurava, Jul 20, 2007.

1. ### rauravaNew Member

Joined:
Jul 20, 2007
Messages:
1
0
Trophy Points:
0
hello all ,
I am new to C programming and trying to learn by working some online tutorials.
I am working on a linux OS ( Ubuntu ) .

so the program is to calculate a table of sine values and I typed in the code pretty much the way it was show in the tutorial, the code is shown below:

Code:
```				/* Written: Winter 1995	*/
#include < stdio.h>
#include < math.h>

void main()
{
int    angle_degree;

printf ("\nCompute a table of the sine function\n\n");

/* obtain pi once for all */
/* or just use pi = M_PI, where
M_PI is defined in math.h 	*/
pi = 4.0*atan(1.0);
printf ( " Value of PI = %f \n\n", pi );

printf ( " angle     Sine \n" );

angle_degree=0;			/* initial angle value 		 */
/* scan over angle 		 */

while (  angle_degree <= 360 )	/* loop until angle_degree > 360 */
{
angle_radian = pi * angle_degree/180.0 ;
printf ( " %3d      %f \n ", angle_degree, value );

angle_degree = angle_degree + 10; /* increment the loop index	 */
}
}```
When I try to complile the program by typing

\$ gcc program_name.c

I get the following error :

/tmp/cciKZE0g.o: In function `main':
sine.c .text+0x58): undefined reference to `sin'
collect2: ld returned 1 exit status

what does this mean ?? what should I do ? can any one help ?

thanks ,
raurava

Last edited by a moderator: Jul 20, 2007
2. ### DaWeiNew Member

Joined:
Dec 6, 2006
Messages:
835
5
Trophy Points:
0
Occupation:
Semi-retired EE
Location:
Texan now in Central NY
http://www.daweidesigns.com

Joined:
Jul 12, 2004
Messages:
15,374
388
Trophy Points:
83
Have proper code blocks when you post code snippets in the posts.

Joined:
Dec 6, 2006
Messages:
835