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,4dcb75e86b22b9a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-03 06:01:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!enews.sgi.com!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!news.cesnet.cz!crax.cesnet.cz!news.felk.cvut.cz!not-for-mail From: "Sergey Koshcheyev" Newsgroups: comp.lang.ada Subject: Re: Interfacing ADA to C++ classes with parameters Date: Wed, 3 Apr 2002 15:53:20 +0200 Organization: Czech Technical University Message-ID: References: NNTP-Posting-Host: m232.dkm.cz X-Trace: ns.felk.cvut.cz 1017841997 14888 62.24.78.232 (3 Apr 2002 13:53:17 GMT) X-Complaints-To: usenet@ns.felk.cvut.cz NNTP-Posting-Date: Wed, 3 Apr 2002 13:53:17 +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:22048 Date: 2002-04-03T15:53:20+02:00 List-Id: 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)); >