title: Static function declared but not defined in C++
body: <p>I'm getting an error from the following code using C++.</p>
  
  <p><strong>Main.cpp</strong></p>
  
  <pre><code>#include "file.h"
  
  int main()
  {
     int k = GetInteger();
     return 0;
  }
  </code></pre>
  
  <p><strong>File.h</strong></p>
  
  <pre><code>static int GetInteger();
  </code></pre>
  
  <p><strong>File.cpp</strong></p>
  
  <pre><code>#include "file.h"
  
  static int GetInteger()
  {
     return 1;
  }
  </code></pre>
  
  <p>The error I get:</p>
  
  <pre><code>Error C2129: static function 'int GetInteger(void)' declared but not defined.
  </code></pre>
  
  <p>I've read the famous article <a href="http://www.gamedev.net/page/resources/_/technical/general-programming/organizing-code-files-in-c-and-c-r1798">"Organizing Code File in C and C++"</a>, but don't understand what is wrong with this code.</p>