Calling Ada routines from C programs.

Jim Showalter jls at yoda.Rational.COM
Mon Feb 18 11:23:37 AEST 1991


mark at array.UUCP (Mark Culp) writes:

I believe you are trying to do this backwards. Pragma Interface allows
Ada to call other languages. I do not believe the LRM specifies how
OTHER languages are to call Ada--that would seem to be more the job
of the linker for the other language than of Ada.

Thus, in your example you have written the Ada Test_C_Interface to be able to
call a C function called "C_Main_Routine". This should work (presuming
you have tools sufficient to link the two languages). But then you try
to call ada_routine from your C program. Does your C linker know how
to do this? If not, this won't work. 
--
***** DISCLAIMER: The opinions expressed herein are my own. Duh. Like you'd
ever be able to find a company (or, for that matter, very many people) with
opinions like mine. 
                   -- "When I want your opinion, I'll beat it out of you."



More information about the Comp.lang.c mailing list