When looking for example I found this one from this Forum:
It's not really the Lazarus version. After all, Lazarus is just an IDE, i.e. an overgrown text-editor.
What really matters is the version of the LCL and you can get that with LCL_FULLVERSION. For example:
{$IF (LCL_FULLVERSION < 1080400)}
ShowMessage('I''ll use workarounds for Lazarus pre-1.8.4');
{$ELSE}
Showmessage('Woah! Congrats! Lazarus is at least 1.8.4.0!')
{$ENDIF}
Based on this I made similar:
var
{$IF (LCL_FULLVERSION >= 4060000)}
handle : TLCLHandle;
{$ELSE}
handle : THandle; //deprecated on Laz 4.6
{$ENDIF}
dmData : TdmData;
When I compile I get errors pointing to this $IF..$ELSE..$ENDIF now added source:
Compile Project, Target: /home/saku/lazarus/CqrlogAlpha/src/cqrlog: Exit code 1, Errors: 2, Warnings: 1
dData.pas(365,5) Error: Incompatible types: got "AnsiString" expected "Int64"
dData.pas(365,5) Error: Compile time expression: Wanted Boolean but got <erroneous type> at IF or ELSEIF
dData.pas(368,21) Warning: Symbol "THandle" is deprecated: "Use TLCLHandle instead of this redefined THandle"
All Googling gives just similar examples.
What is the problem that I can not see?