comp.lang.ada
 help / color / mirror / Atom feed
From: dweller@dfw.net (David Weller)
Subject: Calling Ada (GNAT) from C programs...
Date: 1996/03/27
Date: 1996-03-27T00:00:00+00:00	[thread overview]
Message-ID: <4jcb30$8kc@dfw.dfw.net> (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




             reply	other threads:[~1996-03-27  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-27  0:00 David Weller [this message]
1996-03-30  0:00 ` Calling Ada (GNAT) from C programs Gerd Moellmann
1996-03-30  0:00   ` David Weller
1996-04-01  0:00 ` michael
1996-04-01  0:00   ` Robert Dewar
replies disabled

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