title: Global variable "count" ambiguous
body: <pre><code>#include &lt;algorithm&gt;
  using namespace std;
  
  int count = 0, cache[50];
  
  int f(int n)
  {  
      if(n == 2) count++;
      if(n == 0 || n==1) return n;
      else if (cache[n] !=- 1) return cache[n];
      else cache[n]= f(n-1) + f(n-2);
      return cache[n]; 
  }
  </code></pre>
  
  <p>I used this function with gcc 4.3.4, and got the following error:</p>
  
  <pre><code>prog.cpp: In function ‘int f(int)’:
  prog.cpp:38: error: reference to ‘count’ is ambiguous
  </code></pre>
  
  <p>On my local machine (mingw32), the error I got was <a href="http://picturepush.com/public/8610702" rel="noreferrer">this one</a>, although it's not for <code>int 'cache[]'</code>.</p>
  
  <p>Any reason why?</p>