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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4dcb75e86b22b9a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-04 00:20:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!newsfeed.icl.net!diablo.netcom.net.uk!netcom.net.uk!itchen!hamble.qinetiq.com!not-for-mail From: "John Haddon" Newsgroups: comp.lang.ada Subject: Re: Interfacing ADA to C++ classes with parameters Date: Thu, 4 Apr 2002 09:18:33 +0100 Organization: QinetiQ Message-ID: References: NNTP-Posting-Host: 10.176.81.224 X-Trace: hamble.qinetiq.com 1017908167 1701 10.176.81.224 (4 Apr 2002 08:16:07 GMT) X-Complaints-To: postmaster@qinetiq.com NNTP-Posting-Date: Thu, 4 Apr 2002 08:16:07 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:22085 Date: 2002-04-04T09:18:33+01:00 List-Id: Thanks, The mangled name was test_int_param__1Ai, data can now be passes into the routine, modified and returned OK. The reason that I'm trying to do this is because I need to link to existing C++ code which is class based. Does anyone know of an automatic tool for defining the binding between ADA and C++, C2ADA does not cope with a lot of C++ constructs. John "Sergey Koshcheyev" wrote in message news:a8f1gd$eh8$1@ns.felk.cvut.cz... > 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" 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)? > > > > > -- IS THE FOLLOWING LINE CORRECT? > > pragma import_function(test_int_param," > > test_int_param__1A",(integer,A'Class),(integer)); > > > > >