Original Post
So I'm trying to do a simple forward declaration. The idea is to keep all the SDL-specific stuff out of the header file since that will be included all over. This is the basic setup: the header:
struct ScreenData;
class CScreen {
public:
CScreen();
~CScreen();
private:
ScreenData m_Screen;
}; the source: #include "screen.h"
#include "SDL.h"
struct ScreenData {
SDL_Surface *surface;
int x, y;
};
The problem is that I'm getting a "field 'm_Screen' has incomplete type" error from the compiler (MinGW). It's showing the error in the class declaration in the header. There's also a bunch of errors in the source about m_Screen being undefined, but it starts at the header. Any ideas on what I'm doing wrong?