Help implementing a Dynamic stack template

The title may be a little misleading, as I have the stack template working just fine. I can't for the life of me figure out why I'm getting an unresolved link error in my implementation of it though. I know this code isn't complete as the pop function I've written isn't going to work right, but I'm getting the error when I compile and typically it would mean I mispelled something or didn't include a header file or something but it's all there and spelled correctly. Can someone take a look at this and please tell me what I'm missing? Why am I getting a LNK2019 error from the compiler in reference to the pushItem and popItem functions?

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include <string>
#include "DynamicStack.h"
#include "InventoryBin.h"

using namespace std;

void popItem(DynamicStack<InventoryBin>* inventory);
void pushItem(DynamicStack<InventoryBin>* inventory);
int menu();



int main()
{
	DynamicStack<InventoryBin> *inventory = new DynamicStack<InventoryBin>;
	int menuchoice;
	cout <<"Welcome to Brian's inventory tracker v0.01B\n";
	do
	{
		menuchoice = menu();
		switch (menuchoice)
		{
			case 1: pushItem(inventory);
					break;
			case 2: popItem(inventory);
					break;
		}
	}
	while (menu() != 3);
	
	return 0;
}

void popItem(DynamicStack<InventoryBin> inventory)
{
	InventoryBin item;
	inventory.pop(item);
		
}

void pushItem(DynamicStack<InventoryBin> inventory)
{
	int userint;
	string userstring;
	InventoryBin item;
	cout <<"Please enter the item's serial number:\n";
	cin >> userint;
	item.setSerialNum(userint);
	cout <<"Please enter the date of manufacture:\n";
	cin >> userstring;
	item.setManufactDate(userstring);
	cout <<"Please enter the lot number of the item:\n";
	cin >> userint;
	item.setLotNum(userint);
	
	inventory.push(item);
	
}

int menu()
{
	int userchoice;
	cout <<"Please make a selection from the menu\n";
	cout <<"1 - Add an item to the inventory\n";
	cout <<"2 - Remove an item from the inventory\n";
	cout <<"3 - Quit\n";
	cin >> userchoice;
	return userchoice;
}
bump. This is a really stupid error I'm sure. Can someone please take a look?
I think that error might have to do with not all functions being fully declared.

Like if you made a constructor but then never defined what the constructor was suppose to do.
No I figured it out. I'm an idiot. I declared the funtions in question to accept a pointer but when I defined them I sent them instances of objects not pointers to the object. Doh!
Topic archived. No new replies allowed.