-
July 9th, 2004, 11:18 PM
#1
Senior Member
compilation problem
I was doing the following program in RedHat-9 Linux, but the program is not getting complied, your help is sorted.
------------
#include<stdio.h>
#include<math.h>
int main()
{
double pie,theth,dis,velo=0.0;
printf("\nEnter the angle theta: ");
scanf("%lg",&theth);
printf("\n Enter the angle pie: ");
scanf("%lg",&pie);
printf("\nEnter the velocity of the projectile: ");
scanf("%lg",&velo);
pie=3.1415927/180.0*pie;
theth=3.1415927/180.0*theth;
dis=2.0*velo*velo*cos(theth)*cos(theth)*(tan(theth)-tan(pie)/(9.81 * cos(pie)));
printf("\nThe Distance is: %g",dis);
return 0;
}
------------------------------------------
the following command is used to compile the program.
-------------------------
gcc projectile.c
-------------------------
it shows the following output on the screen, I do not what it means and needs to be done.
-------------------------------------------------------------------------
/tmp/ccC2282K.oC.text+0xbb): In function ‘main’
: undefined reference to ‘cos’
/tmp/ccC2282K.oC.text+0xd4): In function ‘main’
: undefined reference to ‘cos’
/tmp/ccC2282K.oC.text+0xed): In function ‘main’
: undefined reference to ‘tan’
/tmp/ccC2282K.oC.text+0x101): In function ‘main’
: undefined reference to ‘tan’
/tmp/ccC2282K.oC.text+0x11d): In function ‘main’
: undefined reference to ‘cos’
--------------------------------------------------------------------
Thank you for your time and patience.
U get What U pay for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|