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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,2c25d9643f05ffd1,start X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,2c25d9643f05ffd1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-16 17:10:05 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.mathworks.com!nntp.abs.net!lore.csc.com!baen1673807.greenlnk.net!baen1673807!not-for-mail From: "Anthony Moss" Newsgroups: comp.lang.ada,comp.lang.c++ Subject: calling an ada procedure from C++ Date: Wed, 12 Nov 2003 15:11:58 -0000 Organization: Computer Sciences Corporation Message-ID: <3fb24ce4$1@baen1673807.greenlnk.net> NNTP-Posting-Host: 20.44.240.4 X-Trace: lore.csc.com 1069031211 27220 20.44.240.4 (17 Nov 2003 01:06:51 GMT) X-Complaints-To: abuse@news.csc.com NNTP-Posting-Date: Mon, 17 Nov 2003 01:06:51 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Original-NNTP-Posting-Host: stnp5383.stanmre.gecm.com X-Original-Trace: 12 Nov 2003 15:08:20 +0100, stnp5383.stanmre.gecm.com Xref: archiver1.google.com comp.lang.ada:2550 comp.lang.c++:6839 Date: 2003-11-12T15:11:58+00:00 List-Id: I have an ada simulation and a windows C++ graphics program already created. My task is to transfer the information from the ada written simulation to the VisualC++ graphics program. This involves transfering a large structure of information from ada to C++. To do this i have written a very small program to pass a simple structure from ada to C++, but I am getting run time access errors. I will place a copy of the code onto this message, so could you tell me what is wrong and how to fix it. thanks Anthony Moss The ada code is ..... package Output is type Record_T is record First : Integer; Second : Integer; end record; --type Record_Ptr is access Record_T; function Struct return Record_T; pragma Export (C, Struct, "Struct"); end Output; package body Output is function Struct return Record_T is A_Record : Record_T :=(2,4); begin return A_Record; end Struct; end Output; The C++ code is.. typedef struct { int first; int second; } A_Struct; extern "C" { A_Struct Struct(); } int main() { A_Struct A = Struct(); __asm nop; return 0; } ps when iinclude adainit() and adafinal I am getting unresolved external symbol _adafinal..... errors