Unresolved Linker Error Help

My project requires us to build a binary heap. Right now I am testing the insert function with a minimal main. The project won't build and is giving an unresolved linker error. I have no idea what is going on can someone tell what is wrong?

Main
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "binaryHeap.h"
#include "HuffmanNode.h"
#include "HuffmanNodePtr.h"
#include <cctype>

using namespace std;

int main(){
	binaryHeap<int>heap;
	//heap.heapVect.resize(10);
	heap.insert(5);
	//binaryHeap<int>hi;
}



Binary Heap Class. Not finished except trying to test insert.
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
//templated
#include <vector>
#include <iostream>
using namespace std;

template<typename K>
class binaryHeap{
public:
	int size;
	vector<K>heapVect;
	void insert(K newData);//not sure on parameters and type
	K deleteMin();
	int vectSize();
private:

};

template<typename K>
void insert(K newData)//not sure on parameters and type
{
	//heapVect.resize(heapVect.size()+1);
	size=heapVect.vectSize();
	//place the new item at the end of the heap
	heapVect[size]= newData;

	// percollate
	int place = size;
	int parent = (place-1)/2;
	while ( (parent >= 0) &&
		heapVect[place]>heapVect[parent])
	{
		//swap items
		K temp=heapVect[parent];
		heapVect[parent]=heapVect[place];
		heapVect[place]=temp;
	}

	++size;


}
template<typename K>
K deleteMin()
{
	
	//K temp=heapVect.pop();

}
template<typename K>
int size()
{
	return heapVect.size()+1;
}
Topic archived. No new replies allowed.