title: extern local variable for global variable inside namespace
body: <p>The following code works correctly:</p>
  
  <p>file1.cpp</p>
  
  <pre><code>//global variable
  int g_myvar1 = 5;
  </code></pre>
  
  <p>file2.cpp</p>
  
  <pre><code>int myfunc()
  {
     extern int g_myvar1;
     g_myvar1++
  }
  </code></pre>
  
  <p>How can I do file2.cpp if file1.cpp is as follows:</p>
  
  <p>file1.cpp</p>
  
  <pre><code>namespace myns
  {
      //global variable
      int g_myvar1 = 5;
  }
  </code></pre>
  
  <p>NOTE1, the following gives compilation error on GCC 4.7 "invalid use of qualified-name". I tried 'using namespace' with no luck also.</p>
  
  <pre><code>int myfunc()
  {
     extern int myns::g_myvar1;
     g_myvar1++
  }
  </code></pre>
  
  <p>NOTE2, The following works, but I am looking for only-local variable definition.</p>
  
  <pre><code>namespace myns
  {
      //global variable
      extern int g_myvar1;
  }
  int myfunc()
  {
     myns::g_myvar1++
  }
  </code></pre>