I am working on a problem for class and I am getting a
[Linker error] undefined reference to `hypotenuse(double, double)' message. Can someone explain why this is happening. Here is my code:
Code:
#include <stdio.h>
#include <math.h>
/* Function Prototype */
double hypotenuse( double sidea, double sideb );
/* Function main begins program execution */
int main()
{
double sidea; /* Variable in which sidea will be stored */
double sideb; /* Variable in which sideb will be stored */
printf( "Enter the length of side a: \n" ); /* Prompt for input */
scanf( "%lf", &sidea); /* Read number from user */
printf( "Enter the length of side b: \n\n" ); /* Prompt for input */
scanf( "%lf", &sideb); /* Read number from user */
printf( "The length of side c is %lf", hypotenuse( sidea, sideb ) ); /* Display results */
return 0; /* Indicates that program ended successfully */
} /* End function main */
double hypontenuse( double sidea, double sideb )
{
return sqrt( pow( sidea, 2) + pow( sideb, 2) );
} /* End function main */
Thanks in advance
DMKanz07