K
Kenton Groombridge
Hi,
I previous posted this in a gcc and g++ groups since that is the
compiler I am working with, but I didn't get any response.
Hopefully these are the right groups for this question. I am working
(actually playing) on porting Alien vs Predator to Linux. I am using
the code that is available via CVS from icculus.org.
I recently upgraded my gcc to 3.4.1 and now a portion of the code
doesn't compile. Nothing in the code has changed.
I think I figured it out, but want to be sure before I spend a bunch of
time working around it only to find that I was wrong.
My guess is the class ConstIterator makes class Iterator a friend, but
class Iterator is a derived class of the bass class ConstIterator (hope
I said that right). From what I understand and have researched is that
in order for the class ConstIterator to use the class Iterator as a
friend, then class Iterator has to be defined first, and for class
Iterator to be derived from class ConstIterator, then the class
ConstIterator has to be defined first. Essentially a catch 22.
Am I on the right track? If not please point me in the right directly,
but I would like to fix the code. I would like to know how you would
approach the fix for this.
Thanks,
Ken
Here is the error:
g++ -g -Wall -pipe -O2 -DLINUX -Dengine=1 -I. -Iinclude -Iwin95 -Iavp
-Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
-I/usr/include/SDL -D_REENTRANT -c -o win95/awtexld.o win95/awtexld.cpp
In file included from win95/awtexld.cpp:10:
win95/hash_tem.hpp: In member function `void _base_HashTable<TYPE,
ARG_TYPE, CMP_ARG_TYPE>::Iterator::Remove()':
win95/hash_tem.hpp:435: error: `nEntriesRemaining' undeclared (first use
this function)
win95/hash_tem.hpp:435: error: (Each undeclared identifier is reported
only once for each function it appears in.)
win95/hash_tem.hpp:439: error: `nodePP' undeclared (first use this function)
win95/hash_tem.hpp:446: error: `chainPP' undeclared (first use this
function)
win95/hash_tem.hpp:447: error: `nChainsRemaining' undeclared (first use
this function)
win95/hash_tem.hpp: In copy constructor `_base_HashTable<TYPE, ARG_TYPE,
CMP_ARG_TYPE>::_base_HashTable(const _base_HashTable<TYPE, ARG_TYPE,
CMP_ARG_TYPE>&)':
win95/hash_tem.hpp:705: error: expected `;' before "it"
win95/hash_tem.hpp:705: error: `it' undeclared (first use this function)
make: *** [win95/awtexld.o] Error 1
Here is the code in question (not very big, but put in this format so
you can find the lines in question in relation to the errors above):
http://webpages.charter.net/kgroombr/hash_tem.hpp
I previous posted this in a gcc and g++ groups since that is the
compiler I am working with, but I didn't get any response.
Hopefully these are the right groups for this question. I am working
(actually playing) on porting Alien vs Predator to Linux. I am using
the code that is available via CVS from icculus.org.
I recently upgraded my gcc to 3.4.1 and now a portion of the code
doesn't compile. Nothing in the code has changed.
I think I figured it out, but want to be sure before I spend a bunch of
time working around it only to find that I was wrong.
My guess is the class ConstIterator makes class Iterator a friend, but
class Iterator is a derived class of the bass class ConstIterator (hope
I said that right). From what I understand and have researched is that
in order for the class ConstIterator to use the class Iterator as a
friend, then class Iterator has to be defined first, and for class
Iterator to be derived from class ConstIterator, then the class
ConstIterator has to be defined first. Essentially a catch 22.
Am I on the right track? If not please point me in the right directly,
but I would like to fix the code. I would like to know how you would
approach the fix for this.
Thanks,
Ken
Here is the error:
g++ -g -Wall -pipe -O2 -DLINUX -Dengine=1 -I. -Iinclude -Iwin95 -Iavp
-Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
-I/usr/include/SDL -D_REENTRANT -c -o win95/awtexld.o win95/awtexld.cpp
In file included from win95/awtexld.cpp:10:
win95/hash_tem.hpp: In member function `void _base_HashTable<TYPE,
ARG_TYPE, CMP_ARG_TYPE>::Iterator::Remove()':
win95/hash_tem.hpp:435: error: `nEntriesRemaining' undeclared (first use
this function)
win95/hash_tem.hpp:435: error: (Each undeclared identifier is reported
only once for each function it appears in.)
win95/hash_tem.hpp:439: error: `nodePP' undeclared (first use this function)
win95/hash_tem.hpp:446: error: `chainPP' undeclared (first use this
function)
win95/hash_tem.hpp:447: error: `nChainsRemaining' undeclared (first use
this function)
win95/hash_tem.hpp: In copy constructor `_base_HashTable<TYPE, ARG_TYPE,
CMP_ARG_TYPE>::_base_HashTable(const _base_HashTable<TYPE, ARG_TYPE,
CMP_ARG_TYPE>&)':
win95/hash_tem.hpp:705: error: expected `;' before "it"
win95/hash_tem.hpp:705: error: `it' undeclared (first use this function)
make: *** [win95/awtexld.o] Error 1
Here is the code in question (not very big, but put in this format so
you can find the lines in question in relation to the errors above):
http://webpages.charter.net/kgroombr/hash_tem.hpp