In Delphi 7, how can I track the order in which units are compiled?

I have an application that was launched in Turbo Pascal 5 and is now located in Delphi 7 (the roots of the project are over 20 years old). We are trying to move this project to Delphi XE.

There is a unit that is compiled into exe, which should not be compiled into this project at all. I could not correctly track how it gets into the compilation.

Is there a log or any other tools that I can use to view the unit compilation order so that I can trace this problem?

NOTE. I already tried using the ICARUS tool to successfully complete the trace.

EDIT: I'm sure using brute force and enough time, I can solve this problem. I am looking for a more elegant solution, if available.

+4
source share
4 answers

To track an order, you can try using a tool like Process Monitor to monitor I / O. Delphi does not log this information on its own.

To find out why the device is included in your program, there is an easier way. Just remove (or hide) the device. Compilation will fail, and the compiler will point to a uses that mentions a nonexistent unit.

+5
source

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

It will indicate the loading order of the blocks, and probably the block responsible for loading it will be responsible.

+1
source

When I find such a problem in my compilations, I do the following:

  • Check the IDE library path. Delete unnecessary and extraneous directories.

  • Check the project search path. Delete unnecessary and extraneous directories.

  • Delete ALL DCUS.

  • Find the entire contents of the Windows Vista / Windows 7 / Windows8 "virtual store" and delete, in addition, any extraneous BPL or DCP and delete.

  • Create UnitAlias ​​for the unwanted device. unit Alias ​​"UnwantedUnit = GoAway".

  • Build. (Always use Build, not Compile, in such situations)

This makes it easy to find a unit that does not work.

0
source

Rename all occurrences of the .pas file to your file system and delete all the corresponding DCU files. Then create your project. If used, the compiler will detect this.

0
source

All Articles