   Multiple definitions
  I am fairly new to c++ programming, coming from delphi and another obscure language. My problem is that I have a number of  and  files which implement classes.Just a simple example:class ikke {  protected:    memberlist ();};ikke::memberlist (){}Nothing fancy there. These classes implement graphics, resource managing and such (or so they will in future). As can be understood, almost everything needs a couple of these objects. So I made a single  where I defined a number of pointers to these core classes and the header I include everywhere I need them. However, linking results into multiple definitions and I want to avoid this. So, I included the familiar #ifndef __gameobjs and the #define part off course.But the problem persists. Am I missing something? This is my gmobj.h:#ifndef __GAMEDEFS#if ( __GAMEDEFS == 1 ) #error "here again." #include "windowmanager.h"  #include "gfxcore.h"  #include "logger.h" #define __GAMEDEFS 1WindowManager *windowmanager;   // A handle to the game window managergfxcore *screen; // A handle to the game graphics corelogger *logbook; // A handle to the logbook#endif 
  Global variables declared in headers should have the extern storage class specifier. Basically changeWindowManager *windowmanager;toextern WindowManager *windowmanager;And then declare storage in one source file by puttingWindowManager *windowmanager;at namespace scope.For more details see  this article. 