I've been getting frustrated with not knowing why this happen so basically my header file doesnt want to get my function definitions from my cpp file.
I know the functions work cause I can add them to my header file itself and it works fine but it just wont work from my cpp.
main.cpp:
#include "header.h"
using namespace std;
int main()
{
StackType<int> myStack;
return 0;
}
header.cpp
#include "header.h"
using namespace std;
template<class Type>
StackType<Type>::StackType() {}
header.h
using namespace std;
template<class Type>
class StackType
{
public:
StackType();
}
undefined reference to `StackType::StackType()'|