comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Linking Ada to C++ Overloaded Functions and Methods
Date: Sat, 7 Apr 2018 13:25:29 -0700 (PDT)
Date: 2018-04-07T13:25:29-07:00	[thread overview]
Message-ID: <63a87d7f-0ad2-438c-a8b9-3d57b7189674@googlegroups.com> (raw)
In-Reply-To: <959c633f-237d-47ea-88ff-4ad29faeb6c7@googlegroups.com>

On Saturday, April 7, 2018 at 4:07:38 PM UTC-4, Ron Wills wrote:
> On Saturday, April 7, 2018 at 1:05:24 PM UTC-6, Niklas Holsti wrote:
> > 
> > I would try to change the pragma Imports into aspects, something like this:
> > 
> > procedure draw_box (....)
> > with Import,
> >       Convention => CPP,
> >       Link_Name => "_ZNK9Fl_Widget8draw_boxE10Fl_Boxtypej";
> 
> That worked perfectly! Thanks!
> 

One gotcha that you may already be aware of, but just bit me today is
that if you have overloaded functions in a base class, but don't override
all of them in an extension class, you will get "undefined" errors when
calling the versions that are not overridden.  See:
https://stackoverflow.com/questions/1628768/why-does-an-overridden-function-in-the-derived-class-hide-other-overloads-of-the

I was trying out Niklas' suggestion in my ada/cpp scratch space and had it
happen because I extended the ada tagged type and didn't override all of
the imports.


      reply	other threads:[~2018-04-07 20:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 18:35 Linking Ada to C++ Overloaded Functions and Methods Ron Wills
2018-04-07 19:01 ` Dan'l Miller
2018-04-07 19:05 ` Niklas Holsti
2018-04-07 20:07   ` Ron Wills
2018-04-07 20:25     ` Jere [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox