comp.lang.ada
 help / color / mirror / Atom feed
* Calling Ada (GNAT) from C programs...
@ 1996-03-27  0:00 David Weller
  1996-03-30  0:00 ` Gerd Moellmann
  1996-04-01  0:00 ` michael
  0 siblings, 2 replies; 5+ messages in thread
From: David Weller @ 1996-03-27  0:00 UTC (permalink / raw)


(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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-04-01  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-27  0:00 Calling Ada (GNAT) from C programs David Weller
1996-03-30  0:00 ` Gerd Moellmann
1996-03-30  0:00   ` David Weller
1996-04-01  0:00 ` michael
1996-04-01  0:00   ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox