title: undefined reference to a static array of integers
body: <p>I'm a bit new to C++, so I'm making a text RPG sort of thing to test what I've learned. I want to make it so the player is prompted to enter in the class(mage,fighter,archer,etc.) of each of their three characters.</p>
  
  <p>The character classes are stored in a static array of ints called cls[]. I'd prefer to keep things static and not make an object of this class, since almost everything in the game will attempt to access members of the class. But for some reason, it keeps giving me the error message: undefined reference to `playerVars::cls'. I'm guessing this means that it can't find the array or something? I'd really appreciate any light that could be shed on the subject.</p>
  
  <pre><code>intro.h
  -----------------------------
  #ifndef INTRO_H
  #define INTRO_H
  #include &lt;iostream&gt;
  
  using namespace std;
  
  class intro
  {
      public:
          intro();
          int inint;
          void classDecide(int charUsed);
  };
  
  #endif
  
  
  intro.cpp
  -----------------------------
  #include "intro.h"
  #include "playerVars.h"
  
  intro::intro()
  {
      classDecide(0); //Calls the classDecide function using your first of 3 characters
  }
  
  void intro::classDecide(int charUsed)
  {
      cin &gt;&gt; inint;   //Asks for the number of the class that you want
      playerVars::setClass(charUsed,inint);
  }
  
  
  playerVars.h
  -----------------------------
  #ifndef PLAYERVARS_H
  #define PLAYERVARS_H
  
  using namespace std;
  
  class playerVars
  {
      public:
          playerVars();
          static int cls[3];
          static void setClass(int classToSet, int setTo);
  };
  
  #endif
  
  
  playerVars.cpp
  -----------------------------
  #include "playerVars.h"
  
  playerVars::playerVars()
  {
  }
  
  void playerVars::setClass(int classToSet, int setTo)
  {
      cls[classToSet]=setTo;  //sets the class of player classToSet to setTo
              //undefined reference to `playerVars::cls'
  }
  </code></pre>