title: Bug in Delphi 2009? -> *.res not found in project search path (works in Delphi 2006)
body: <p>I have a problem migrating from Delphi 2006 to Delphi 2009. A Project which uses the JVCL complains that jvconsts.res is missing. The file is definitly there. The project search path includes the directory where the file is located. (Note: I don't have JVCL in my global search path to make it more portable)</p>
  
  <p>But the file should be found, as the <a href="http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/compdirsresourcefile_xml.html" rel="noreferrer">Delphi Help</a> says:</p>
  
  <blockquote>
    <p>"... the linker searches for .res
    files [...] in the directories
    specified in the Search path input box
    on the Directories/Conditionals page
    of the Project|Options dialog box"</p>
  </blockquote>
  
  <p>This is not a JVCL problem: A minimalistic program shows this:</p>
  
  <p>Imagine this directory structure:</p>
  
  <pre><code>C:\Test\ResTest.dpr
  C:\Test\Res\Test.res
  </code></pre>
  
  <p>Here is ResTest.dpr:</p>
  
  <pre><code>program ResTest;
  
  {$R test.res} // not found even if "c:\Test\Res" is in project search path
  
  begin
  end.
  </code></pre>
  
  <p>This compiles fine in Delphi 2006 but not in Delphi 2009. 
  After some searching I found, a way to tell Delphi where the file is: The gobal search path or the -R parameter using the command line compiler. </p>
  
  <p>As I write this, I come closer to the real problem: In Delphi 2006 the .cfg-File includes the lines:</p>
  
  <pre><code>-I"c:\Test\Res"
  -U"c:\Test\Res"
  -R"c:\Test\Res"
  </code></pre>
  
  <p>Basicly it copies the values from the project search path into the 3 command line options and so it makes sure that the -R parameter has the right values.</p>
  
  <p>In Delphi 2009 (I set the verbosity of the compiler output to "debug") I get the resulting command line from the IDE:</p>
  
  <p>If the directory (c:\Test\Res) is included in the project search path:</p>
  
  <pre><code>dcc32.exe --no-config -M -Q -ID:\Sources\Temp\1\Res;"c:\program files\codegear\rad studio\6.0\Lib" -LE"C:\Users\Public\Documents\RAD Studio\6.0\Bpl" -LN"C:\Users\Public\Documents\RAD Studio\6.0\Dcp" -O"c:\program files\codegear\rad studio\6.0\Lib" -R"c:\program files\codegear\rad studio\6.0\Lib" -UD:\Sources\Temp\1\Res;"c:\program files\codegear\rad studio\6.0\Lib" -K00400000   ResTest.dpr
  </code></pre>
  
  <p>If the directory is included in the global search path</p>
  
  <pre><code>dcc32.exe --no-config -M -Q -ID:\Sources\Temp\1\Res;"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res -LE"C:\Users\Public\Documents\RAD Studio\6.0\Bpl" -LN"C:\Users\Public\Documents\RAD Studio\6.0\Dcp" -O"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res -R"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res -UD:\Sources\Temp\1\Res;"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res -K00400000   ResTest.dpr   
  </code></pre>
  
  <p>Maybe its hard to see here: The difference is the -R parameter:</p>
  
  <pre><code>Local Search Path -&gt; -R"c:\program files\codegear\rad studio\6.0\Lib"
  Global Search Path -&gt; -R"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res
  </code></pre>
  
  <p>So it's no wonder why it doesn't work. The local search path is not appended to the -R Parameter in Delphi 2009. </p>
  
  <p>I would say, this is clearly a bug, but why seems that nobody else has this problem? I can reproduce it on all machines we use. Maybe the error only exists in the German version of Delphi 2009? </p>