Mail Archives: djgpp/1998/04/07/13:00:32
Hello Sed,
Sed Johnson <oplop AT mailexcite DOT com> schreef in artikel
<OPACMBMALOKEAAAA AT mailexcite DOT com>...
>
> Hello,
>
> I recently upgraded from DJGPP 2.00 to 2.01, I
> upgraded from GPP/LGPP272 to GPP/LGPP280, etc.
Hmm, haven't yet but will do. <g>
> Since I've upgraded my DJGPP though, I get several
> errors on compilation. I searched through the FAQ
> and the inf files and could not find anything that
> I was doing wrong. Here is a bit of the code that
> is causing errors:
>
> .....
> template <class T> class Node
> {
> friend Iter<T>;
> friend List<T>;
> private:
> .....
>
> Iter and List are classes which are described
> after this class.
Shouldn't you have the declarations for Iter<T> and List<T> before your
Node class?
Try what happens if you put the following lines before class Node in your
code:
template<class T> class Iter;
template<class T> class List;
> There are also a few other errors I get too, but I
> think if someone could help me understand why I'm getting errors now,
after it worked
> perfectly before, I
> can figure out the rest.
>
> Any ideas why this code is longer is working, please?
Personally I'm supprised it worked anyhow if your source was as you
described.
If the definitions of Iter<T> and List<T> come after the Node class they
don't exist as far as the compiler is concerned, unless you declare them
before Node. After that it isn't important where the definition resides.
--
Greetings from sunny Amsterdam
Jan
email: bijster AT worldonline DOT nl
http://home.worldonline.nl/~bijster
- Raw text -