[Lazarus] Get LCL revision or version via ifdef

cobines cobines at gmail.com
Tue Oct 4 15:24:50 CEST 2011


2011/10/4 silvioprog <silvioprog at gmail.com>:
> I'm needing to use in the uses clause, as I showed in my first
> example. But in the uses clause the FPC is not accepting the
> compilation.

I think it is not possible as it seems the constants are not declared
while in the interface uses section. You can use it in the uses
implementation section. Checked with FPC trunk too.

unit test2;
{$mode objfpc}{$H+}
interface
uses
  LCLVersion
  {$IF DECLARED(lcl_fullversion)}
  {$ERROR interface}
  {$ENDIF}
  ;

implementation

  {$IF DECLARED(lcl_fullversion)}
  {$ERROR implementation}
  {$ENDIF}

begin
end.

$ fpc test2.pas
Free Pascal Compiler version 2.7.1 [2011/09/09] for i386
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test2.pas
test2.pas(17,4) Error: User defined: implementation

--
cobines




More information about the Lazarus mailing list