I am making a class for graph, maybe i am not doing it the best way but the idea was to start for somewhere. I have this class graph.h
template <class T>
struct node
{
int index;
T name;
vector<int> neighbours;
};
struct lengths{
int node_1;
int node_2;
int length;
};
template <class T>
class graph : public vector<node<T>>
{
public:
graph();
...
}
and graph.cpp
template <class T>
graph<T>::graph(){
directed = false; //flag for dir graph, default false
nodes = 0; //number of nodes in the graph
}
and in main i have
graph<int> g;
but when i try to build it i get error
main.cpp undefined reference to `graph<char>::graph()'
I use GNU GCC Compiler [-std=c++14]