title: C++ unresolved external symbol
body: <p>Hi iam begginer at c++ i have class with static methods and i cant access them it throws me an error</p>
  
  <pre><code>    1&gt;------ Build started: Project: CPractice, Configuration: Debug Win32 ------
  1&gt;  Source.cpp
  1&gt;Source.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; CPractice::name" (?name@CPractice@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
  1&gt;c:\users\innersoft\documents\visual studio 2012\Projects\CPractice\Debug\CPractice.exe : fatal error LNK1120: 1 unresolved externals
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>and here is my code </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;cstdlib&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class CPractice
  {
      public:
          static void setName(string s)
          {
              name = s;
          }
          static string getName()
          {
              return name;
          }
      private:
          static string name;
  };
  
  
  int main()
  {
  
  
      CPractice::setName("Name");
      cout &lt;&lt; "\n" &lt;&lt; CPractice::getName();
      system("PAUSE");
      return EXIT_SUCCESS;
  }
  </code></pre>