title: function already defined in .obj
body: <p>From what I understand, this error is caused by not properly using header guards when you have multiple files including the same file.  In my case, this is the include tree that's causing the error:</p>
  
  <p><code>File A includes Z, which contains the functions I need.  File B includes A, and file C includes A.</code></p>
  
  <p>Without any <code>#pragma once</code>'s, The program gives a bunch of variations of the same error:</p>
  
  <pre><code>blahblah.obj: error LNK2005: class some::namespace::ObjectType Object already 
      defined in dialogDlg.obj
  </code></pre>
  
  <p>I just was wondering, given the include tree I described, what is the proper way to get this to compile properly?</p>
  
  <p>I tried using <code>#pragma once</code> on file Z, but that didn't work.  I also tried #pragma once on file A, which also didn't work.  Finally I tried it on both A and Z, also didn't work.</p>