[fpc-pascal] Re: weird compile error message

Sven Barth pascaldragon at googlemail.com
Wed Sep 11 17:36:52 CEST 2013


On 11.09.2013 17:01, Xiangrong Fang wrote:
> Hi,
>
> "Missing -T" is not the problem, the problem is "undefined reference",
> which caused fatal error.
>
> I filed a bug report: http://bugs.freepascal.org/view.php?id=25001
>
> I am pretty sure this is a bug, becuase while I continue to add code to
> my TTree class, this problem is gone!  In another word, it seems only
> occur in the code I attached in that bug report.
>
> Maybe someone in charge of the compiler can analyze the problem ?

See my comment on the bug report.

Additional note: The "PTree = ^TTree" in front of the "TTree" is wrong 
and only supported by pre-2.7.1 FPC by accident. The correct code would be:

=== code begin ===

type
   generic TTree<T> = class
   public type
     PTree = ^TTree;
   private
     ...
   end;

=== code end ===

Though this type and the "FParent: PTree" part wouldn't be needed 
anyway. "FParent: TTree" is sufficient and the property can be declared 
as "property Parent: TTree read FParent".

I suggest you to test generic related code with 2.7.1 as well to check 
whether code is a) still supported (and then ask here whether it's 
intended that something is not supported any longer) or b) already fixed 
if it's something that does not work in 2.6.x

Regards,
Sven



More information about the fpc-pascal mailing list