title: C++ Access private static member from public static method?
body: <p>Let's say I have a .hpp file containing a simple class with a public static method and a private static member/variable.
  This is an example class:</p>
  
  <pre><code>class MyClass
  {
  public:
      static int DoSomethingWithTheVar()
      {
          TheVar = 10;
          return TheVar;
      }
  private:
      static int TheVar;
  }
  </code></pre>
  
  <p>And when I call:</p>
  
  <pre><code>int Result = MyClass::DoSomethingWithTheVar();
  </code></pre>
  
  <p>I would expect that "Result" is equal to 10;</p>
  
  <p>Instead I get (at line 10):</p>
  
  <pre><code>undefined reference to `MyClass::TheVar'
  </code></pre>
  
  <p>Line 10 is "TheVar = 10;" from the method.</p>
  
  <p>My question is if its possible to access a private static member (TheVar) from a static method (DoSomethingWithTheVar)?</p>