title: How can I avoid the LNK2005 linker error for variables defined in a header file?
body: <p>I have 3 cpp files that look like this</p>
  
  <pre><code>#include "Variables.h"
  void AppMain() {
      //Stuff...
  }
  </code></pre>
  
  <p>They all use the same variables inside them so they have the same headers but I get stuff like this</p>
  
  <pre><code>1&gt;OnTimer.obj : error LNK2005: "int slider" (?slider@@3HA) already defined in AppMain.obj
  </code></pre>
  
  <p>Why is that?</p>