Search code examples
delphilegacy-codedelphi-11-alexandria

Delphi Cannot compile used unit in from custom package


First of all, I am not used to Delphi. I am assigned to get a grip of a comprehensive collection of Delphi applications. Working through a ton of compilation challenges I now am stuck at a faulty unit reference. The author of the applications is not available to assist.

There is an application which uses a custom package. I have managed to recompile the package and add it to the application project. However, there is a single component which somehow just does not seem to be recognized properly. It is present in the .bpl and with no errors. But when the component is referenced in the application, it says that the used unit could not be compiled (as in it cannot locate it).

Since Delphi is completely new territory for me, I am unsure as to what code snippets to include.

I can tell that the applications initially are from 2009, and procedurally upgraded over time. We are now at Delphi 11, but legacy packages etc. still lingers.

I hope someone can be of assistance

I have walked through a bunch of compilation challenges and defined Packages and Library Path's. Most of it seem to have been combed through though. I have looked through the .bpl project a lot, and it does appear OK to me. I have compiled the package to a /Dcu/ directory and referenced that in the Packages menu. It imported fine and the troublesome component is mentioned in the 'Components' option.

Restarting the IDE and reimporting does not seem to fix anything.


Solution

  • With help from other sources I managed to locate the issue. QuickReport was blocking compilation. I had to recompile first QR Runtime package and then QR Design time package. Then I could install QuickReport the correct way in Package Manager. Afterwards my custom package was able to compile and install