Sign in Join

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

Mailing lists / fpc-devel / 2011-12

Problems with namespaces and structs

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Andrew Brunner

class
storage
class
Folders

        Type
             Item=record
             end;
             PItem=^TItem
             TItems=array of PItem

Variables in some other unit compile OK.

----
in some other unit:

  type MyCallback=procedure(Var Items:Storage.Folders.TItems); // linking fails
  // procedures/functions of these namespaced types fail to link  with

the following messages

/Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x1692): undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346' /Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x16ca): undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346'

Can Anyone can fix this soon? This particular unit involves heavy namespace usage for complex organization.

Reply by email

Paul Ishenin
to Andrew Brunner

16.12.11 1:58, Andrew Brunner пишет:

Show quoted text 28 lines
class storage class Folders Type Item=record end; PItem=^TItem TItems=array of PItem Variables in some other unit compile OK. ---- in some other unit: type MyCallback=procedure(Var Items:Storage.Folders.TItems); // linking fails // procedures/functions of these namespaced types fail to link with the following messages /Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x1692): undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346' /Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x16ca): undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346' Can Anyone can fix this soon? This particular unit involves heavy namespace usage for complex organization.

Can you report a small but full example to the bug tracker?

Best regards,
Paul Ishenin

Reply by email

Andrew Brunner
to Paul Ishenin

Probably,

I got it to work by declaring the Callback Event Type in the Storage.Folders area and declared that type in the other unit which linked just fine.

It appears that the references cannot be located from outside that namespace.

Paul Ishenin wrote 43 lines
16.12.11 1:58, Andrew Brunner пишет: > class >   storage >   class >      Folders >         Type >              Item=record >              end; >              PItem=^TItem >              TItems=array of PItem > > > Variables in some other unit compile OK. > > ---- > in some other unit: >   type MyCallback=procedure(Var Items:Storage.Folders.TItems); // linking > fails >   // procedures/functions of these namespaced types fail to link  with > the following messages > > > > /Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x1692): > undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346' > > /Developer/Source/Builds/Aurawin/Linux/Sync/64/.Output/x86_64-linux/frmMain.o:(.data+0x16ca): > undefined reference to `RTTI_$DBMUSERSTORAGE_$$_DEF346' > > > Can Anyone can fix this soon?  This particular unit involves heavy > namespace usage for complex organization. Can you report a small but full example to the bug tracker? Best regards, Paul Ishenin _______________________________________________ fpc-devel maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Hans-Peter Diettrich
to Andrew Brunner: I got it to work by declaring the Callback Event Type in the Storage.Folders area and…
Show quoted text 5 lines
I got it to work by declaring the Callback Event Type in the Storage.Folders area and declared that type in the other unit which linked just fine. It appears that the references cannot be located from outside that namespace.

That's why I wonder what namespaces are *good* for :-(

Disambiguation by unit.class.method/property works very well, so why add more levels to that hierarchy?

I also wonder how such deep hierarchies should be documented, so that help can be shown when needed?

DoDi

Reply by email