All, I am implementing a LinkedList and am experiencing the following error. As far as I searched, this hasn't been asked before. What does unresolved external symbol mean? This is a Win32 console application. Any help would be appreciated. Apologies in advance for the code formatting. I haven't figured it out yet.
LNK2019 unresolved external symbol "public: void __thiscall List::push_front(int const &)" (?push_front@?$List@H@@QAEXABH@Z) referenced in function _main
List.cpp
#include "stdafx.h"
#include "List.h"
#include "Node.h"
template <typename Type>
List<Type>::List()
{
head = NULL;
tail = NULL;
count = 0;
}
template <typename Type>
List<Type>::~List()
{
}
template <typename Type>
bool List<Type>::empty()
{
return count == 0;
}
template <typename Type>
int List<Type>::size()
{
return count;
}
template <typename Type>
void List<Type>::push_front(const Type &d)
{
Node *new_head = new Node(d, NULL, head);
if (this->empty())
{
head = new_head;
tail = new_head;
}
else
{
head->prev = new_head;
head = new_head;
}
count++;
}
template <typename Type>
void List<Type>::push_back(const Type &d)
{
Node *new_tail = new Node(d, NULL, tail);
if (this->empty())
{
head = new_tail;
tail = new_tail;
}
else
{
tail->next = new_tail;
tail = new_tail;
}
count++;
}
template <typename Type>
void List<Type>::DisplayContents()
{
Node *current = head;
for (int i = 0; i <= this->size; i++)
{
cout << current->data << " ";
current = current->next;
}
}
</pre></code>
LinkedList.cpp
#include "stdafx.h"
#include "List.h"
int main()
{
List<int> listIntegers;
listIntegers.push_front(10);
listIntegers.push_front(2011);
listIntegers.push_back(-1);
listIntegers.push_back(9999);
listIntegers.DisplayContents();
return 0;
}