Delphi Error – E2190 Thread local variables cannot be ABSOLUTE

Delphi Compiler Error

E2190 Thread local variables cannot be ABSOLUTE

Reason for the Error & Solution

A thread local variable cannot refer to another variable, nor can it reference an absolute memory address.

program Produce;

  threadvar
     secretNum : integer absolute $151;

begin
end.

The absolute directive is not allowed in a threadvar declaration section.

program Solve;

  threadvar
    secretNum : integer;

  var
    sNum : integer absolute $151;

begin
end.

There are two easy ways to solve a problem of this nature. The first is to remove the absolute directive from the threadvar section. The second would be to move the absolute variable to a normal var declaration section.

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