Delphi Error – E2265 Interface ‘%s’ not mentioned in interface list

Delphi Compiler Error

E2265 Interface ‘%s’ not mentioned in interface list

Reason for the Error & Solution

An implements clause references an interface which is not mentioned in the interface list of the class.

program Produce;
type
  IMyInterface = interface
  end;

  TMyClass = class(TInterfacedObject, IUnknown)
    FMyInterface: IMyInterface;
    property MyInterface: IMyInterface read FMyInterface implements IMyInterface;
  end;
end.


The example shown here uses implements with the IMyInterface interface, but it is not mentioned in the interface list.

program Solve;
type
  IMyInterface = interface
  end;

  TMyClass = class(TInterfacedObject, IUnknown, IMyInterface)
    FMyInterface: IMyInterface;
    property MyInterface: IMyInterface read FMyInterface implements IMyInterface;
  end;
end.


A quick solution, shown here, is to add the required interface to the interface list of the class definition. Of course, adding it to the interface list might require the implementation of the methods of the interface.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...