Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-02

Problem with nested classes and types

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

I'm using the trunked FPC/Lazarus (just updated) and I have a problem with nested types. Ubuntu x64 10.10

dbmVDM.pas

type
  VDM=class
  type
   DB=class
   const
      stuff = 0;
      // fields removed for simplicity even more subclasses
    end;
  end;
  Resources=class
  type
    DB=class
    const
      stuff = 0;
    end;
    TResource=record // 79
       foo:integer;
       bar:string;
    end;
    PResource=^TResource; //80
  end;
uXMPPd.pas
uses ... dbmVDM;
type // no nested classes
TClientSessionData=record
  foo : string;
  bar : integer;
  Resource : dbmVDM.Resources.PResource; //(error *_DEF80) also fails
on just Resources.TResource (error *_DEF79)
end;

Project syntax looks good but fails on link.

//Developer/Source/Builds/SCS/Linux/64/Output/uXMPPd.o:(.data+0x1ccc):
undefined reference to `RTTI_DBMVDM_DEF79'
Service.lpr(15,1) Error: Error while linking

I had an identical problem a few days ago but reverted to using generic Pointer and casting with no problems. I had a test case outside my project but can't duplicate this
like linker can't find subclass type of dbmVDM.Resources.TResource.

Needing a fix so I can use my elaborate name-space system :-) Any help would be greatly appreciated.

Reply by email

Paul Ishenin
to Andrew Brunner
Andrew Brunner wrote 5 lines
Project syntax looks good but fails on link. //Developer/Source/Builds/SCS/Linux/64/Output/uXMPPd.o:(.data+0x1ccc): undefined reference to `RTTI_DBMVDM_DEF79' Service.lpr(15,1) Error: Error while linking

Please fill a bug report with full example. I will look at it when I have some free time.

Best regards,
Paul Ishenin

Reply by email