C++ template, linking error

Viewed 29416

I have a problem in calling a template class I have. I declared a new type name Array, which is a template;

In the .hpp file:

template <typename T>
class Array
{
public:
   Array();
};

In the .cpp file:

template <typename T>
Array<T>::Array()
{
//Do something
}

In main:

Array<int> arr;

I get Linkage error: unresolved external symbol to the ctor.

Any Idea?

6 Answers
Related