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