Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Delphi 7, how do I trace the order in which the units are being compiled?

I have an application which was started in Turbo Pascal 5 and is now at Delphi 7 (the roots of the project are over 20 years old). We are attempting to move this project to Delphi XE.

There is a unit which is being compiled into the exe which should not be compiled into this project at all. I have been unable to properly trace how it is entering into the compilation.

Is there a log or some other means that I can use to see the order of the units being compiled so that I can trace down this problem?

NOTE: I have already attempted to use the ICARUS tool to accomplish the trace without success.

EDIT: I'm sure that using brute force and enough time I can solve this issue. What I'm seeking is a more elegant solution if one is available.

like image 209
Hobo Joe Avatar asked Mar 23 '23 08:03

Hobo Joe


2 Answers

To trace the order, you might try using a tool like Process Monitor to monitor disk I/O. Delphi doesn't log that kind of information itself.

To discover why the unit is being included in your program, there's an easier way, though. Simply delete (or hide) the unit. Compilation will fail, and the compiler will point at the uses clause that mentions the nonexistent unit.

like image 192
Rob Kennedy Avatar answered Apr 13 '23 21:04

Rob Kennedy


My answer in the question Can I determine the order in which my units have been initialized? can help here.

It will list the load order of units and it's likely that the unit before is responsible for loading it.

like image 21
Remko Avatar answered Apr 13 '23 23:04

Remko