error LNK2019

I have the following code:
# include <iostream>
# include <iomanip>
using namespace std;
using std::cin;
using std::cout;
using std::endl;

//function prototypes
double calcAverage (double, double, double);
void getTestScore(double&, double&, double&);
void displayAverage (double);



//main
int main ()
{
double score_1 = 0.0;
double score_2 = 0.0;
double score_3 = 0.0;
double average = 0.0;

//get score inputs from getTestScores
getTestScore(score_1, score_2, score_3);

//calculate average
average = calcAverage (score_1, score_2, score_3);

//display average
displayAverage (average);

return 0;
}

//**********function definitions**********

//getTest Scores
void getTestScore(double& score_1, double& score_2, double& score_3)
{
cout << "Enter score 1:" << endl;
cin >> score_1;
cout << "Enter score 2:" << endl;
cin >> score_2;
cout << "Enter score 3:" << endl;
cin >> score_3;
}//end getTestScore

//calcAverage
double calcAverage (double& score_1, double& score_2, double& score_3)
{
double average = 0.0;
average = (score_1 + score_2 + score_3) / 3.0;
return average;
}//end calcAverage

//displayAverage
void displayAverage (double& avgerage)
{
cout << "The average is " << avgerage <<"." <<endl;
}//end displayAverage


I am getting the errors:
error LNK2019: unresolved external symbol "void __cdecl displayAverage(double)" (?displayAverage@@YAXN@Z) referenced in function _main

and

error LNK2019: unresolved external symbol "double __cdecl calcAverage(double,double,double)" (?calcAverage@@YANNNN@Z) referenced in function _main

I am relatively new to C++ and do not know how to fix this error.
The function prototypes probably don't match the definitions.
I've tried modifying the prototypes and function calls but they seem to match.
you are missing & in the .function declarations.

Also, built in types are better passed as value compared to references if you are not to be changed.
Topic archived. No new replies allowed.