I have been working on this code for days now and I thought I finally got it all figured out but then I got these two errors when I went to build it. I have tried everything and can't figure it out. Any help would be greatly appreciated!
Error 1: Error 1 error LNK2019: unresolved external symbol "public: double __thiscall Inventory::GetMarkUp(void)const " (?GetMarkUp@Inventory@@QBENXZ) referenced in function "public: void __thiscall Inventory::Display(void)const " (?Display@Inventory@@QBEXXZ) C:\Users\documents\visual studio 2012\Projects\StoreInventory\StoreInventory\Inventory.obj StoreInventory
if (NextChar == '\n')
{
cin.ignore();
}
cin.get( InitProductDescription, 49);
cout << "Enter The Quantity Of The Product In Stock:" << endl;
cin >> InitProductInventory;
It was working before when I used Getters/Setters but the instructor wanted us to const instead of set. After I changed it, I received the error referenced above.
I did clean and rebuild in VS but I'm still getting the same error. I also tried it again and I'm still getting the error.
So where is the implementation of your GetMarkup() class method? You have declared it, but you never defined it. Maybe you removed it?
The errors you received pointed exactly to what the problem is, "unresolved external symbol/unresolved symbols" means the compiler couldn't find the code for the function.
PLEASE learn to use code tags, it makes it MUCH easier to read your code:
http://www.cplusplus.com/articles/jEywvCM9/
1 2 3 4 5 6
#include <iostream>
int main()
{
std::cout << "Using Code Tags is FUN!\n";
}