Mail Archives: djgpp/1999/10/24/09:59:16
Rithe wrote:
> Ok, here we go. The error message that I get is at run time. There are
> a number of errors, and all are pretty much the same. One is: Error:
> undefined reference to 'List<int>::List(void)' My whole list class is
> template, so it should work. Am I just missing something somewhere?
>
> Brian Ronk
>
> Davin McCall et.al. wrote:
> > That's more than a little vague. Maybe you could post the source,
> > along with the *exact* wording of the error message.
> >
> > Also, you say that it compiles fine ... does that mean that you are
> > getting the message at run time (ie when you actually run your
> > program)?
> >
> > Davin.
> >
> >
> > On Mon, 11 Oct 1999 16:56:14 -0700, Rithe <rithe AT xoommail DOT com> wrote:
> >
> > >I was working on a template, and found that it
> > >isn't working right. It is a List. The error I
> > >get is something like:
> > >Cannot find List<int>, etc
> > >I hope you know what I mean. Everything compiles
> > >fine, so I know that it is semi right. I'm just
> > >not sure why it is giving those errors when it is
> > >a template. Any ideas?
> > >
> > >Brian Ronk
> >
Erm...I had this problem...I'm not sure if you're having the same one as
mine but anyway, did you definte the template class in a header file and
implemented it in separate C++ file? It compiles fine but DJGPP refuses to
link it...
To solve the problem I simply dump the implementation of the class in the
same header file where I defined it...try that, hope it helps...
Kai
- Raw text -