title: why i can't call a static member variable in an static member function like this?
body: <p>everyone! there is a code snippet like the below:
  <strong>testcase.cpp</strong></p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  class Test {
  public:
      static int b ;
      static void test()
      {
  
          b = 3;
           cout &lt;&lt; b&lt;&lt;endl;
      }
  };
  int main()
  {
  Test::test();
  
      return 0;
  }
  </code></pre>
  
  <p>when I click  "build" button,the output message is</p>
  
  <blockquote>
    <p>error LNK2001: unresolved external symbol "public: static int Test::b" (?b@Test@@2HA)
    1>B:\PROGRAMPROJECT\visual 2015 pro\testcase\testcase\x64\Debug\testcase.exe : fatal error LNK1120: 1 unresolved externals</p>
  </blockquote>
  
  <p>but,when i change the code location like this:</p>
  
  <pre><code>  #include "stdafx.h"
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  class Test {
  public:
      //static int b;
      static void test()
      {
          static int b;//only change this line
          b = 3;
          cout &lt;&lt; b &lt;&lt; endl;
      }
  };
  int main()
  {
      Test::test();
  
      return 0;
  }
  </code></pre>
  
  <p>It does work!
  I don't know why?Anybody can help me?
  My IDE is vs pro 2015 + windows10.</p>