[fpc-pascal] [2.3.1] Can't take the address of constant expressions

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Dec 4 12:48:22 CET 2007


On 04 Dec 2007, at 12:06, Damien Gerard wrote:

> I am trying the 2.3.1 and I can not recompile my projects.
> I ve got the message :Can't take the address of constant expressions.
>
> I have only the following :

No, you have more:

bigmac:~/fpc/test jonas$ cat tt4.pp
{$mode delphi}

TMyClass = class(TObject)
    p_ref : TAnotherClass;
    procedure setRef(AValue: TANotherClass);
public
    property ref: TAnotherClass read p_ref write setRef;
end;
bigmac:~/fpc/test jonas$ ppcppc27 tt4
Free Pascal Compiler version 2.3.1 [2007/12/01] for powerpc
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Darwin for PowerPC
Compiling tt4.pp
tt4.pp(3,9) Fatal: Syntax error, "BEGIN" expected but "identifier  
TMYCLASS" found
Fatal: Compilation aborted

(even adding "type" and a dummy declaration for TAnotherClass is not  
enough to get the error message you are reporting)

> TMyClass = class(TObject)
>    p_ref : TAnotherClass;
>    procedure setRef(AValue: TANotherClass);
> public
>    property ref: TAnotherClass read p_ref write setRef;
> end;
>
> Where am I wrong for the 2.3.1 ?

Please post the full source needed to reproduce the error message you  
are getting.


Jonas



More information about the fpc-pascal mailing list