title: Error lnk2005 already defined in .obj
body: <p>There are many question about this error. But they are related to only a single variable.</p>
  
  <p><strong>test.h</strong></p>
  
  <pre><code>namespace World
  {
      enum Objects
      {
          TERRAIN = 1,
          BOX = 2,
          SPHERE = 4,
          CAPSULE = 8
  
      };  
  
      void WorldObjects2(unsigned int mask)
      {
        .......
      }
  }
  
  void test();
  </code></pre>
  
  <p><strong>test.cpp</strong></p>
  
  <pre><code>#include "test.h"
  
  void test()
  {
      .......
  }
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "test.h"
  int main()
  {
      test();
      return 0;
  }
  </code></pre>
  
  <p>When I run these code on visual stduio 2013, it throws an error. It says that <code>error LNK2005: "void __cdecl World::WorldObjects2(unsigned int)" (?WorldObjects2@World@@YAXI@Z) already defined in main.obj</code>. How can I correct this error?</p>