Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

package

delphi

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?

like image 761
Robert Oschler Avatar asked Nov 23 '11 22:11

Robert Oschler


2 Answers

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.

like image 67
Mason Wheeler Avatar answered Nov 15 '22 02:11

Mason Wheeler


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

like image 22
awmross Avatar answered Nov 15 '22 02:11

awmross