I have exempted actual code for the sake of simplification, so this is basically how it goes:

I have these files:

BaseDecoder.h
YDecoder.h
Decoder.h
Decoder.cpp

BaseDecoder.h declares an abstract BaseDecoder class.

YDecoder.h declares a YDecoder class derrived from BaseDecoder and includes BaseDecoder.h.

Decoder.h declares a Decoder class (not inherited from anything) which contains a member of type BaseDecoder (and other misc. methods), and includes BaseDecoder.h.

Decoder.cpp implements Decoder class member methods such as getFileName and setDecoder and includes Decoder.h and YDecoder.h.

The error that i'm getting is:
cannot declare member function `Decoder::getFileName' within `YDecoder'

getFileName is declared in Decoder.h, not in YDecoder, yet gcc somehow thinks it is.

I've tried some forward declarations of the BaseDecoder class in Decoder.h and YDecoder.h, but that just creates different errors.

Thanks to any suggestions.