comp.lang.ada
 help / color / mirror / Atom feed
From: "Sergey Koshcheyev" <serko84@hotmail.com>
Subject: Re: Interfacing ADA to C++ classes with parameters
Date: Wed, 3 Apr 2002 15:53:20 +0200
Date: 2002-04-03T15:53:20+02:00	[thread overview]
Message-ID: <a8f1gd$eh8$1@ns.felk.cvut.cz> (raw)
In-Reply-To: a8ete9$sa8$1@hamble.qinetiq.com

Hi,

The link name you use in pragma Import_Function below is wrong. It
corresponds to A::test_int_param(void) - try running c++filt and typing the
mangled name into it.

You have to figure out the correct link name and use that. Also, are you
sure that the A'Class argument should be the last in the argument list? I
would myself expect the "this" pointer to be the first argument, but I don't
know the low-level details.

Sergey.

"John Haddon" <jf_haddon@QinetiQ.com> wrote in message
news:a8ete9$sa8$1@hamble.qinetiq.com...
> Dear All,
>
> I'm having a problem writing an interface to a C++ class in which I want
to
> pass a parameter in addition to the object. I attach the package spec, the
> main program and the C header file. The interface compiles and links with
> the main program EXCEPT for TEST_INT_RET. On linkage, the following error
is
> given:
>
> ./ex6d_main.o: In function `ex6d_main__dispatch':
> C:/PROGRA~1/GNAT/Examples_jfh/ex6d_main.adb:25: undefined reference to
> `A::test_int_param(void)'
>
> Why is this trying to refer to A::test_int_param(void) and not
> A::test_int_param(integer,void)?

> <snip>
> -- IS THE FOLLOWING LINE CORRECT?
>       pragma import_function(test_int_param,"
> test_int_param__1A",(integer,A'Class),(integer));
> <snip>






  reply	other threads:[~2002-04-03 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03 12:46 Interfacing ADA to C++ classes with parameters John Haddon
2002-04-03 13:53 ` Sergey Koshcheyev [this message]
2002-04-04  8:18   ` John Haddon
2002-04-05 15:44     ` Robert Dewar
2002-04-05 19:15       ` Ted Dennison
2002-04-03 14:28 ` Mário Amado Alves
2002-04-03 19:01 ` Stephen Leake
replies disabled

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