Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which declaration is causing a unit to be implicitly imported?

Tags:

package

delphi

I'm installing some custom components for a project.
I wrote these many years ago so it's a bit fuzzy how things got linked.

I'm getting many warnings like:

[dcc32 Warning] Life32v2.dpk(53): W1033 Unit 'DDUtils' implicitly imported into package 'Life32v2'

However when I do a Find in files ctrlshiftF for DDUtils it is nowhere to be found in the project(group).
Obviously DDUtils is used by a unit that is explicitly imported by one of my components or the link is even more indirect than that.

Doubleclicking on the error simply takes me to the dpk file which is useless.

Is there a way to see by which route a unit gets imported?

like image 242
Johan Avatar asked Oct 16 '25 04:10

Johan


1 Answers

You can easily find the unit that uses it.

Simply find DDUnit (.pas and/or .dcu) on your harddisk and rename it to say, old_DDUnit.pas and/or old_DDUnit.dcu. Then recompile and the compiler will tell you which unit can't compile because it can't find DDUnit.

I usually use the free, excellent and terribly fast everything.exe search tool to find any file name or folder on my system.

Of course an IDE tool would be nice, but the above works fine.

like image 187
Rudy Velthuis Avatar answered Oct 18 '25 12:10

Rudy Velthuis