Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Linker    [ Add a report in this area ]  
Report #:  73249   Status: Closed
*.res not found in project search path
Project:  Delphi Build #:  12.0.3210.17555
Version:    12.1 Submitted By:   Steffen Binas
Report Type:  Basic functionality failure Date Reported:  4/22/2009 8:53:03 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   261097
Resolution: Fixed (Resolution Comments) Resolved in Build: : 15.0.3890.34076
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 6
Description
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][1] 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. See Steps to Reproduce

    [1]: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/compdirsresourcefile_xml.html
Steps to Reproduce:
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.
Workarounds
none
Attachment
None
Comments

Belman Kraul at 7/15/2009 9:23:13 AM -
I was wondering if there is an equivalent to the {$R } directive in C++ Builder, in order to make this work. It is really annoying that the .res files will not be located even if  the correct paths are on the search path.

Server Response from: ETNACODE01