Question

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?

Was it helpful?

Solution 2

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

Open up all the packages for which you have source code, and specify the compile option: 'Rebuild explicitly' instead of 'Rebuild when needed'.

OTHER TIPS

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.

You thus have three options for fixing this problem:

  • Turn off "rebuild as needed". This seems to be the most common solution.
  • Put your package files (*.dpk, *.dproj) into a separate directory and then reinstall the packages. I have done this, with success.
  • Remove the directory containing your .dpk and .pas files from the library path. Note that Delphi will add it back again in certain circumstances, including when you install/reinstall your package.

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.

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.

Sometimes the problem was file access permissions.

A workaround was run Delphi as Administrator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top