Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi "E2161 Error: RLINK32: Error opening file ________.drf " during Build All

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?

like image 377
Jamo Avatar asked Dec 23 '22 10:12

Jamo


2 Answers

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.
like image 56
asciiphil Avatar answered Dec 28 '22 09:12

asciiphil


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

like image 23
Jamo Avatar answered Dec 28 '22 07:12

Jamo