Original Post
ok , lets say i got two C++ header files :
Display.h
Surface.h
and in these two headers im defining class''s and in each of them im #include the other header file , like that:
Display.h:
#ifndef __DISPLAY_H
#define __DISPLAY_H
#include ... // all the directx stuff
#include ... // all the directx stuff
#include ... // all the directx stuff
#include "Surface.h"
class CDisplay {
.... // some code here
....
....
};
typedef CDisplay *LPCDisplay;
#endif
Surface.h:
#ifndef __SURFACE_H
#define __SURFACE_H
#include ... // all the directx stuff
#include ... // all the directx stuff
#include ... // all the directx stuff
#include "Display.h"
class CSurface {
.... // some code here
....
....
};
typedef CSurface *LPCSurface;
#endif
now , when im trying to compile something like it , im getting lots of error , like redefintion error etc....
here is some of them:
:\gearcade\cgsurface.h(31) : error C2535: ''long __thiscall CGSurface::CreateSurface(void)'' : member function already defined or declared
c:\gearcade\cgsurface.h(30) : see declaration of ''CreateSurface''
c:\gearcade\cgsurface.h(33) : error C2061: syntax error : identifier ''LPCGDisplay''
why its happening ?
*************************
"Everything you know is wrong" - Bono
*************************