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