Student Programmer needs help with function

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

Please help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
	}
Last edited on
Hi, you made a mistake in your function name: line 26

calculateRatail and not calcaulateRetail
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.
Last edited on
Thank you both!
Last edited on
Topic archived. No new replies allowed.