Hi!
I will try to explain my problem in the simplest way. I have a template class Queue, as follows:
Code:
template<class T>
class Queue{
public:
explicit Queue();
void add(T);
T get();
private:
sem_t sem_struct;
sem_t sem_count;
list<T> elements;
Queue(Queue&);
Queue& operator=(const Queue&);
};
// definitions...
The definitions are inside this file. Other two files include this header. There is other file that includes these two files. I compile each file separately. The two files that include the template compile succesfully. But, when I try to compile the third file, I have compiler error:
In file included from ether.h:15,
from host.cpp:2:
fila.h:8: redefinition of `class Queue<T>'
fila.h:8: previous definition of `class Queue<T>'
The general structure of the files are:
ether.h includes queue.h
application.h includes queue.h
host.cpp includes application.h and ether.h
Thanks any help!