Delphi Error – E2121 Procedure or function name expected

Delphi Compiler Error

E2121 Procedure or function name expected

Reason for the Error & Solution

You have specified an identifier which does not represent a procedure or function in an EXPORTS clause.

library Produce;

  var
   y : procedure;

exports y;
begin
end.

It is not possible to export variables from a built-in library, even though the variable is of ‘procedure’ type.

program Solve;

  procedure ExportMe;
  begin
  end;

exports ExportMe;
begin
end.

Always be sure that all the identifiers listed in an EXPORTS clause truly represent procedures.

Share:

Leave A Reply

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

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...