Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualGameGeazer

Posted 24 February 2013 - 09:53 AM

Hey, I've been getting an error "Undefined reference to  Game:: window." I was wondering how I would go about declaring a static variable, initializing it, and accessing it properly. Thanks for your time.

 

cc file:

sf::RenderWindow* const Game::getWindow(void){
        return Game::window;
    }

 

h file:

public:
 static sf::RenderWindow* const getWindow(void);
private:
static sf::RenderWindow* window;

#1GameGeazer

Posted 24 February 2013 - 09:51 AM

Hey, I've been getting an error "Undefined reference to  Game:: window." I was wondering how I would go about declaring a static variable (in c++), initializing it, then accessing it properly. Thanks for your time.

 

cc file:

sf::RenderWindow* const Game::getWindow(void){
        return Game::window;
    }

 

h file:

public:
 static sf::RenderWindow* const getWindow(void);
private:
static sf::RenderWindow* window;

 

 


PARTNERS