title: C++ private static member variables
body: <p>This C++ code is producing linker errors at compile time:</p>
  
  <pre><code>// A.h
  class A {
      public:
          static void f();
      private:
          static std::vector&lt;int&gt; v;
  };
  
  // A.cpp
  void A::f() {
      // this line is causing trouble
      int i = v.size();
  }
  </code></pre>
  
  <p>Moving the vector declaration into the cpp file works. However I want to understand the linker error <code>"Undefined symbols"</code> cause in the above code. What is causing the linker error in the above code?</p>