[Anjuta-list] Error: undefined reference to cos even after including math.h in the C Program
- From: Jnanesh <jnanesh vsnl net>
- To: anjuta-list lists sourceforge net
- Subject: [Anjuta-list] Error: undefined reference to cos even after including math.h in the C Program
- Date: Fri Apr 4 16:53:02 2003
I am using GNU Compliler gcc 3.2 on Red Hat Linux. When I build the C
program given below after compiling
/* Created by Anjuta version 1.0.1 */
/* This file will not be overwritten */
#include <stdio.h>
#include <math.h>
#define pi 3.1415
int main()
{
double a;
a=sin(pi/2);
printf("a = %lf",a);
return(0);
}
It gives the error as
main.c:9: undefined reference to sin
Please help to overcome this problem
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]