[Lazarus] Get LCL revision or version via ifdef

silvioprog silvioprog at gmail.com
Tue Oct 4 23:52:06 CEST 2011


2011/10/4 cobines <cobines at gmail.com>:
> 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

I solved my problem using a manual definition(*), without use the LCLVersion.

Thanks to all.

(*) http://code.google.com/p/lazsolutions/source/browse/trunk/Core/lazsolutions.inc

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
LazWebSolutions - <code.google.com/p/lazwebsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================




More information about the Lazarus mailing list