Both class declarations are in their own unit file.
That suggests that both have nothing to do with the other. But still you want one to have knowledge about the other. It sounds like a little design mixup, but that doesn't need to be the case.
There are multiple solutions, here are three of them, each with its own purpose:
- Place both classes in the same unit, only if both classes have a common theme/subject (e.g.
TCar and TAirplane in the unit Transport),
- Use one unit in the other unit, only if both units represent different subjects, but one may depend on the other (e.g. unit
Transport uses unit Fuel: TCar needs TDiesel, but TDiesel doesn't need a TCar). This only works one-way. Delphi prevents using in both ways with a compiler error: "Circular unit reference to 'Fuel'". The only workaround is to use the second unit in the implementation section, but that usually is considered a big nono.
- Declare a new base-class in a new unit, only if the base-class has a common subject, but the final descendants do not (e.g.
TFuel is used by all transportation classes like TCar, TAirplane and THorse, but TFood (a descendant of TFuel) is only used by THorse and TPerson).
As for how to link both classes together, see the already given answers.