title: C++ extern variables already defined in *.obj
body: <p>In a header file, I have a namespace that stores some extern pointers to use as global variables. This header file is then included in a few .cpp files that use its implementation. When I compile, I get the error for each global:</p>
  
  <pre><code>LNK2005 "void * Globals::gHandle" already defined in Engine.obj 
  </code></pre>
  
  <p>How the variables are written in the header:</p>
  
  <pre><code>namespace Globals
  {
      extern HANDLE gHandle = nullptr;
      extern void* processBaseAddress = nullptr;
      extern void* smBaseAddress = nullptr;
  }
  </code></pre>
  
  <p>The header file is using #ifndef so I shouldn't be included more than once. Some functions either get or set the values of these global variables.</p>