6

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)

But the file should be found, as the Delphi Help says:

"... 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"

This is not a JVCL problem: A minimalistic program shows this:

Imagine this directory structure:

C:\Test\ResTest.dpr
C:\Test\Res\Test.res

Here is ResTest.dpr:

program ResTest;

{$R test.res} // not found even if "c:\Test\Res" is in project search path

begin
end.

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.

As I write this, I come closer to the real problem: In Delphi 2006 the .cfg-File includes the lines:

-I"c:\Test\Res"
-U"c:\Test\Res"
-R"c:\Test\Res"

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.

In Delphi 2009 (I set the verbosity of the compiler output to "debug") I get the resulting command line from the IDE:

If the directory (c:\Test\Res) is included in the project search path:

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

If the directory is included in the global search path

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   

Maybe its hard to see here: The difference is the -R parameter:

Local Search Path -> -R"c:\program files\codegear\rad studio\6.0\Lib"
Global Search Path -> -R"c:\program files\codegear\rad studio\6.0\Lib";D:\Sources\Temp\1\Res

So it's no wonder why it doesn't work. The local search path is not appended to the -R Parameter in Delphi 2009.

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?

1 Answer 1

2

A workaround is to put this in your code in stead:

{$R res\test.res}

That works on my system with Delphi 2009, both with the IDE and the command-line compiler.

Note that I agree that they broke existing functionality, did you add a report to Quality Portal? If not, please do: ttps://quality.embarcadero.com (this used to be the search engine indexed http://qc.embarcadero.com but that has been shut down; https://quality.embarcadero.com requires a free account to search).

4
  • This would work with our code, but I have to modify thirdparty code (JVCL) which I really like to avoid. Commented Apr 22, 2009 at 15:49
  • I created an entry in QualityCentral for this bug #73249 Commented Apr 22, 2009 at 15:58
  • 2
    I agree with the fact that you do not want to modify 3rd party code. Thx for the report. I just checked qc.codegear.com/wc/qcmain.aspx?d=73249, amended some of the report fields, then promoted it so the Q&A team at CodeGear will see it in their internal system Commented Apr 22, 2009 at 18:51
  • Note that QualityCentral has now been shut down, so you can't access qc.embarcadero.com links anymore. If you need access to old QC data, look at QCScraper. Commented Jun 9, 2017 at 17:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.