Undefined Reference

#include <cstdlib>
#include <iostream>

using namespace std;

float calcCharges(float);
void calcTotal(float&);



int main(int argc, char *argv[])
{
float hours,charge=0;

cout<<"Enter your total hours (Enter -1 to exit): ";
cin>>hours;

while (hours!=-1)
{

cout<<"The amount of charge is: RM"<<calcCharges(hours)<<endl<<endl;
charge=calcCharges(hours);
calcTotal(charge);
cout<<"The total amount of charge is: RM"<<charge<<endl;
cout<<"Enter your total hours: ";
cin>>hours;

}


system("PAUSE");
return EXIT_SUCCESS;
}

float calcCharges(float value1)
{
float charge=0;
if (value1<=1)
charge=1.00;
else if (value1>1 && value1<=19)
charge=1+((value1-1)*0.50);
else
charge=10;

return charge;
}

void caclTotal(float &charge)
{
float totalCharge;
totalCharge=totalCharge+charge;
charge=totalCharge;
}




the compiler keeps produce an error message: [Linker error] E:\labq15tutorial/main.cpp:23: undefined reference to `calcTotal(float&)'

how to solve the undefined reference error? anyone can help me fix this please...
Typo. When defining your function, you've called it caclTotal.
hey thank you..im so careless.. =='
Topic archived. No new replies allowed.