title: C++ Shared Library not Allowing Static Data Member Access
body: <p>I have a .cpp file that looks something like this:</p>
  
  <pre><code>//other code
  namespace {
      class C1;
      class C2;
      class C2{
           public: static int counter;
           //member functions here
      };
      class C1{
           //other code
           C2::counter = 10;
      };
  }
  </code></pre>
  
  <p>When I run 'make' I get the following error:</p>
  
  <pre><code>relocation R_386_GOTOFF against undefined symbol '(anonymous namespace)::C2::counter' can not be used when making a shared object...
  </code></pre>
  
  <p>Am I missing something simple here?  Shouldn't the static int be available for class C1 to change it?  Also, I am developing this as a part of the Clang library's. Also, I can share the Makefile if that helps.</p>