 <p><code>extern</code> declares a variable, but does not define it. It basically tells the compiler there is a definition for <code>x</code> somewhere else. To fix add the following to <code>header.c</code> (or some other <code>.c</code> file but <em>only</em> one <code>.c</code> file):</p> <pre><code>int x; </code></pre> <p>Note that in <code>main()</code> the local variable <code>x</code> will hide the global variable <code>x</code>.</p>