From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ccaa5b69da45ea4f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-01 19:13:37 PST Path: archiver1.google.com!news1.google.com!postnews1.google.com!not-for-mail From: Volkert.Barr@freenet.de (Volkert) Newsgroups: comp.lang.ada Subject: Problems with the GNAT/C++ Interface. Date: 1 Nov 2001 19:13:37 -0800 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 62.104.208.74 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1004670817 28251 127.0.0.1 (2 Nov 2001 03:13:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 2 Nov 2001 03:13:37 GMT Xref: archiver1.google.com comp.lang.ada:15608 Date: 2001-11-02T03:13:37+00:00 List-Id: Hello c.l.a! Problem: I want an Ada Binding to the following recursive C++ class declaration: class Chainable { public: Chainable *next, *prev; Chainable(); void reset(); }; The following Ada package Chainable_Type seams for me an obvious corresponding Ada type declaration: package Chainable_Type is type Chainable; type Chainable_Access is access all Chainable'Class; type Chainable is tagged limited record next : Chainable_Access; prev : Chainable_Access; end record; ... end Chainable_Type; So far so good. Now i say the GNAT Compiler that the tagged type Chainable has to be mapped to the corresponding C++ class: package Chainable_Type is type Chainable; type Chainable_Access is access all Chainable'Class; -- (*) type Chainable is tagged limited record next : Chainable_Access; prev : Chainable_Access; Vptr : Interfaces.CPP.Vtable_Ptr; -- new end record; pragma CPP_Class (Entity => Chainable); -- new ... end Chainable_Type; compiling this package gnat says: error : pragma "Cpp_Class" applicable to a record, tagged record or record extension. Ok, the problem seems the incomplete type declararion in line (*). Do is miss something? Volkert