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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,52882f38318f3520 X-Google-Attributes: gid103376,public From: Chris Brand Subject: Re: Linking an ADA routine to a program written in C Date: 1996/09/20 Message-ID: <3242C60B.747D@ccgate.hac.com>#1/1 X-Deja-AN: 184208893 references: <51p2vu$enf@lal.interserv.com> <01bba5e0$cf06b040$328371a5@dhoossr.iquest.com> <1996Sep19.075836.1@eisner> <32424C10.71A3@netvision.net.il> content-type: text/plain; charset=us-ascii organization: Hughes Canada Systems Division mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 5.5 sun4c) Date: 1996-09-20T00:00:00+00:00 List-Id: Calius wrote: > [snip] > > I'm sorry to "barge" into your thread here :), but I can tell you this: > I've called ADA procedures which require elaboration from C several > times. I know > it works, and as Larry, it "just happens". I can, however, explain WHY > is "just > happens" (Or so I think): > > [more snipping] I've used ada code with a C main program and with at least one compiler (DEC compiler on an Alpha, I think), you had to call an elaboration routine before calling any ada. You also had to call a "finalisation" routine when you'd finished calling ada. There is usually some sort of compiler option to tell it to create an object file rather than an executable, and it should include all the necessary ada code (including "with"ed library packages) if you do this. As has already been mentioned, you need to tell the ada code that your subprogram will be called from C, and possibly what it should be known as to the linker. You then just use your C compiler as usual and include your ada object file in the link. -- Chris Stating my own opinions, not those of my company.