The library I'm using has class G and class S which inherits G.
I needed to add functionality to them, so I wrapped G and S, rather I inherited from them making Gnew and Snew respectively.
So, my inheritance is:
G --> Gnew | v S --> Snew
But, I want to use Gnew in Snew and when I try to include the Gnew header (in the Snew implementation file) to use it ... the include guards mask the definition of Gnew in Snew???
How can I use Gnew in Snew? Right now, the compiler wont even let me forward declare Gnew in the Snew definition file (which doesn't make sense to me) unless I forward declare inside the class.
In Snew (if I forward declare before the Snew definition) I have:
...
Gnew *g;
The error is:
error: ISO C++ forbids declaration of ‘Gnew’ with no type
If I change Snew to say:
...
class Gnew *g;
Gnew *g;
The error is:
error: invalid use of undefined type ‘struct Snew::Gnew’
NOTE: I was trying to abstract the problem, so I'm closing this and reopening a better phrasing of the question ...