I am working on a price markup program using function and I keep getting these errors:
1.0Error 1 error LNK2019: unresolved external symbol "int __cdecl calculateRetail(int,int)" (?calculateRetail@@YAHHH@Z) referenced in function _main
2. Error 2 error LNK1120: 1 unresolved externals
int calculateRetail( int num1, int num2);
int main()
{
int whole_sale, percent, markup;
int num1, num2;
cout << "Whole sale price :$ ";
cin >> whole_sale;
cout << "Markup percentage :";
cin >> percent;
markup = calculateRetail(whole_sale, percent);
//Display area.
cout << "Total price of the item after markup is :$ " << calculateRetail(whole_sale, percent) << endl;
system("pause");
return 0;
}
/*************************************************************
* Double Calculate Retail *
* This function returns the markup input by the user *
*************************************************************/
int calcaulateRetail(int num1, int num2)
{
return (num1 *num2) + num1;
}
The error is saying that the compiler was successfully able to match the prototype declaration at line 1 with the function calls at lines 14 and 17.
However, the linker was unable to find the definition of any function matching that declaration - because of the misspelling as pointed out by aleonard.