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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,51114679936bf41a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 13 May 2006 12:05:14 -0500 Date: Sat, 13 May 2006 13:02:33 -0400 From: Jeffrey Creem User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Calling C++ from Ada References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-Bv7ln2eEFc3Bo4JLrR6J6jJyOvs+zPOJsJW8CMpucI0coScD4oQHrxgtVeddAi4PYRDMJ3UIRAToNgy!Cf3XYtRtIic8YI8qRwnTwlMFn0PcKf2RPIIsGdcOhSlrHzCoG69k1h60gAM+BU5DAG4A0qh9/aF1!cWI= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:4232 Date: 2006-05-13T13:02:33-04:00 List-Id: Yves Bailly wrote: > Hello all, > > I'm trying to use C++ classes from an Ada program. Searching around, I > found some examples, but none implying a non-default constructor. > I tried some advices found in > http://www.pegasoft.ca/resources/boblap/19.html#19.5, which work well, > but it seems one can only use default constructors. Using various versions > of GNAT (including the one coming with the latest GCC 4.2.0), when trying > to use the pragma CPP_Constructor with a function taking more than zero > parameters, I get this message : > imported.ads:36:27: non-default constructors not implemented > > Does anyone have any clue about this ? > > Thanks and best regards, > > Yves Bailly > Direct interface to C++ from Ada is outside the scope of the Ada (at least 95) LRM. GNAT has some vendor specific pragmas that can be used but I have never heard of any widespread use of these pragmas in any publically avaialble code. There is a paper on the topic being presented at the GCC summit this summer http://www.gccsummit.org/2006/view_abstract.php?content_key=26 In any case, outside of something heavy like an ORB or vendor specific such as GNATCOM I have not seen anything that looks to promising in this area yet. You probably need to interface to it the same way a C programmer would - with non classed based externs.