Mail Archives: djgpp/1994/06/22/17:02:31
I'm copiling a my program by djgpp.
I have 2 file: list.h and list.cpp
In list.h I have:
...
template <class Tipo>
class List
{
public:
friend ostream& operator << (ostream& , List<Tipo>&);
...
}
#include<list.cpp>;
#end
In file list.cpp I have
template<class Tipo>
ostream& operator << (ostream& s, List<Tipo>& l)
{
...
...
}
When I compile appear this message:
proval.cc(.text+6c): undefined reference to '__ls__FR7ostreamRt5List17i'
If I fuse 2 file:
template<class Tipo>
class List
{
public:
friend ostream& operator << (ostream& s , List<Tipo>& L)
{
...
return s;
}
is all right and program goes. Why ? Where I wrong ?
Thanks, Vanni
- Raw text -