title: Visual Studio 2010 & 2008 can't handle source files with identical names in different folders?
body: <p><strong>Direct Question:</strong> If I have two files with the same name (but in different directories), it appears that only Visual Studio 2005 can handle this transparently??  VS 2008 &amp; 2010 require a bunch of tweaking?  Aside from my naming convention, am I doing something wrong?</p>
  
  <p><strong>Background:</strong></p>
  
  <p>I'm developing C++ statistical libraries...  I have two folders:</p>
  
  <pre><code>/ Univariate
  
  Normal.cpp
  Normal.h
  Beta.cpp
  Beta.h
  Adaptive.cpp
  Adaptive.h
  
  / Multivariate
  
  Normal.cpp
  Normal.h
  Beta.cpp
  Beta.h
  Adaptive.cpp
  Adaptive.h
  </code></pre>
  
  <p>I need to support cross compilation -- I'm using g++/make to compile these same files into a library in Linux.  They work just fine.</p>
  
  <p>I had been using Visual Studio 2005 without issue, but I need to upgrade to Visual Studio 2008 or 2010 (currently drooling over nVidia's nsight tool).  However, I'm having trouble if I add files to a project with the same name (even if they're in a different directory).  I'm willing to change my naming convention, but I'm curious if others have encountered this problem and have found any <strong>well</strong> documented solutions??</p>
  
  <p>I'm further boggled by the fact that if I upgrade from 2005 projects to 2010 projects, it appears that VS 2010 <strong>is</strong> able to correctly handle two source files with the same name in different directories; however, if I remove one of the duplicate files and then add it back to the project I am greeted by the following warning:</p>
  
  <p>Distributions\Release\Adaptive.obj : warning LNK4042: object specified more than once; extras ignored</p>
  
  <p>Now I have the intermediate directory specified as $(ProjectName)\$(Configuration) -- I need to have my object files in a different location from my source tree.  So I can see why it's copying the object files on top of each other, but when the projects are converted from 2005 to 2008 or 2010, a bunch of conditional compiles are added:</p>
  
  <pre><code>&lt;ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'"&gt;$(IntDir)%(Filename)1.obj&lt;/ObjectFileName&gt;
  &lt;XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'"&gt;$(IntDir)%(Filename)1.xdc&lt;/XMLDocumentationFileName&gt;
  </code></pre>
  
  <p>These are accessible from the Source file Properties page in C/C++ -> Output Files -> "Object File Name" &amp; "XML Documentation File Name".  But if I simply add the file directly (or remove and re-add them), VS doesn't complain until I try to compile, but also never adds the conditional directives -- So in order for things to work correctly, I have to add the conditional directives myself for every single configuration.  Am I making a mistake / poor assumption or have I uncovered a valid bug in VS 2008 / 2010?</p>