HomeDelphiDelphi Error – E2070 Unknown directive – ‘%s’

Delphi Error – E2070 Unknown directive – ‘%s’

Delphi Compiler Error

E2070 Unknown directive – ‘%s’

Reason for the Error & Solution

This error message appears when the compiler encounters an unknown directive in a procedure or function declaration.

The directive is probably misspelled, or a semicolon is missing.

program Produce;

procedure P; stcall;
begin
end;

procedure Q forward;

function GetLastError: Integer external 'kernel32.dll';

begin
end.

In the declaration of P, the calling convention “stdcall” is misspelled. In the declaration of Q and GetLastError, we’re missing a semicolon.

program Solve;

procedure P; stdcall;
begin
end;

procedure Q; forward;

function GetLastError: Integer; external 'kernel32.dll';

begin
end.

The solution is to make sure the directives are spelled correctly, and that the necessary semicolons are there.

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...