views:

791

answers:

4

I am trying to resolve a problem with a set of packages that apparently have dependency issues. Occasionally during a Build All, I get this error:

Delphi "E2161 Error: RLINK32: Error opening file ____.drf "

What does it mean / indicate, and what is a "drf" file?

+1  A: 

Hmm... never heard of them. I just searched the project that inspired the question you linked to, and there's nothing in there with a "DRF" extension. Checking here doesn't turn up anything Delphi-related. But the fact that it's a linker error, not a compiler error, would lead me to guess that the first two letters stand for "Delphi Resource."

Try a search through your project's directory tree and see if you can find anything with a DRF extension. If so, try opening it with a text editor to see if it's readable, and if not, try a hex editor if you know anything about reading binary file formats. See if you can make any sense of it.

If you don't find any, then Delphi's probably getting it from somewhere in the code it's compiling. Try running a grep search for "DRF" on your directory tree and see if it turns up anything.

Mason Wheeler
+3  A: 

From http://www.delphifaq.com/faq/delphi/delphi_ide/f157.shtml :

When you compile with packages, you can specify which packages should be considered for linkage. The package requirements of the project get stored into a temporary Windows resource file with a .DRF extension.

Whatever that file with the many underscores is, the linker is most probably searching it in what it thinks the tempdirectory is (you can confirm this using filemon). The explanation at DelphiFaq, where a misdefined %TEMP% is the culprit, is as likely as any reason.

Paul-Jan
The DelphiFAQ error occurs when writing .drf files. The problem described above is an error opening the file. (And is apparently a known, long-running Delphi bug.)
asciiphil
A: 

It looks like this turned out to be the main problem / solution.

Jamo
+1  A: 

In addition to the Solving the 'cannot find drf file' problem when compiling packages article, I also came across Delphi bug report #44134, in which a commenter mentions that the problem stems from having your .dpk files in the same directory as your .pas files when that same directory is in the library path and "rebuild as needed" is enabled.

The usual recommendation seems to be to turn off "rebuild as needed". I was unable to do that, but I solved the problem by putting my package files (.dpk, .dproj) into a separate directory and reinstalling the packages.

asciiphil
Very helpful / good to know -- thanks for the info. (Sounds like we've been down similar paths).
Jamo