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: 109fba,fd7e47dd49751091,start X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,fd7e47dd49751091,start X-Google-Attributes: gid103376,public From: nasser@apldbio.com (Nasser Abbasi) Subject: on calling Ada from C/C++ Date: 1996/06/12 Message-ID: X-Deja-AN: 159787053 sender: news@biosys.apldbio.COM organization: Applied BioSystems followup-to: comp.lang.ada newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-06-12T00:00:00+00:00 List-Id: this is fyi: This is a little note about calling Ada subprogram from C++ . I started 2-3 hours ago to learn how to call Ada from C++, I still need to learn more about this. But it turned out much easier than I as I thought it would be. The main issues are on how to declare the Ada subprograms in C++, and how to make sure the way the Ada subprogram is called matches the way it expects to be called. A C++ main calls an Ada procedure to update an integer. (I also use C in this example just for testing.) I also show the steps used to build the program, and few points at the end about few things. This was done on solaris 2.5, using gnat 3.04. file main.cc ------------- #include #include extern "C" { void Ada_Function(int*); void adainit(); // this and adafinal are calls to ada void adafinal(); // rtl to insure things are initialized } // and finailized ok... main() { int i=0; adainit(); // call befor any other ada call printf("This is a C printf ... \n"); cout<<"this is C++ cout..."<