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,6cc079ad718119ff,start X-Google-Attributes: gid103376,public From: dweller@dfw.net (David Weller) Subject: Calling Ada (GNAT) from C programs... Date: 1996/03/27 Message-ID: <4jcb30$8kc@dfw.dfw.net>#1/1 X-Deja-AN: 144936126 organization: DFWNet -- Public Internet Access newsgroups: comp.lang.ada Date: 1996-03-27T00:00:00+00:00 List-Id: (Posted on c.l.a instead of to report@gnat.com because I think this issue is of general interest to those that, well, are interested :-) (But I cc'ed them anyway :-) I'm trying to get the special GNAT binding feature to work with some C code and getting unresolved symbols. I can't seem to find documentation on it...I have a feeling it's simething simple. Here's the source: package Greetings is procedure Hello; procedure Goodbye; end Greetings; with Text_IO; package body Greetings is procedure Hello is begin Text_Io.Put_Line("Hello there from Ada-land!"); end Hello; procedure Goodbye is begin Text_Io.Put_Line("Goodbye, going back to C-land :-( "); end Goodbye; end Greetings; /* main.c */ main (){ /* Initialize Ada runtime */ adainit(); /* Call the routines */ greetings__hello(); greetings__goodbye(); /* Wrap things up */ adafinal(); } gnatbind -n greetings.ali is called, then the linkage command is ld main.o b_greetings.o greetings.o Which gives... /usr/lib/ld: Warning: Unresolved : system___elabs interfaces__c_streams___elabs ada__exceptions___elabs ada__tags___elabb ada__streams___elabs system__tasking_soft_links___elabb system__secondary_stack___elabb system__finalization_root___elabs system__finalization_implementation___elabs ada__finalization___elabs ada__finalization__list_controller___elabs system__file_control_block___elabs ada__text_io___elabs system__file_io___elabb ada__text_io___elabb system__finalization_implementation__finalize_global_list ada__text_io__put_line$2 Perhaps an incorrect environment variable? -- GNAT = GNAT is Not an Ada Translator ==Ada 95 Booch Components: www.ocsystems.com/booch or www.dfw.net/~dweller== Reality: Work, Work, Work, Guitar. | Plugged: Fender Telecaster Deluxe Fantasy: Guitar, Guitar, Guitar, Work(ha!) | Unplugged: Yamaha CG-150SA