Robert Oschler
Robert Oschler

Reputation: 14375

How to hunt down a unit being 'implicitly imported' in a Delphi 6 package?

My main package of custom controls I wrote in Delphi 6 is extremely large with many units including other units and so on. I am trying to figure out which unit source file is responsible for implicitly importing a particular unit into the package. The only information the compiler gives me is the standard 'Unit {unit name} implicitly imported into package {package name}', which sadly does not tell the name of the unit that forced the import. Does anyone know of a tool or a technique to quickly pinpoint the unit responsible?

Upvotes: 5

Views: 884

Answers (2)

Mason Wheeler
Mason Wheeler

Reputation: 84540

Try finding the implicitly imported unit and renaming it. (Make sure to clear all your DCUs too or this won't work.) When the compiler tries to build the unit that's using it, it won't find it and it will give you an error showing exactly where it's being used.

Upvotes: 6

awmross
awmross

Reputation: 3839

GExperts has a "Project Dependencies" function. You click on a Unit and it will tell you which Units use that Unit. It also has an "indirect dependencies" function, which will tell you all the Units a Unit requires, even indirectly.

GExperts can be downloaded for free here

Upvotes: 6

Related Questions