comp.lang.ada
 help / color / mirror / Atom feed
From: jgb@gsyc.inf.uc3m.es (Jesus M. Gonzalez)
Subject: Re: Help! --Interfacing GNAT 3.05 to C libraries
Date: 1997/05/08
Date: 1997-05-08T00:00:00+00:00	[thread overview]
Message-ID: <u2wwpaxc4o.fsf@hola.gsyc.inf.uc3m.es> (raw)
In-Reply-To: 33719153.6BCC@laurel.datsi.fi.upm.es


"Manuel A. Fernandez Fernandez" <mfernan@laurel.datsi.fi.upm.es> writes:

	I think you are doing things the hard way. Use gnatmake,
that will make your life a lot easier. For instance, if you want
to compile your ada-program.adb which make a call to Foo, which
can be found in libFoo.a library, you can just type:

	gnatmake ada-program --largs -lFoo

	Of course, this assumes that -Foo can be found in the default
library path. For more options of gnatmake, just browse the file
gnatinfo, which you should have got with your Gnat distribution.

	Good luck!!!

		Jesus.

> 
> I have been trying to use both Ada 95 with C libraries, like 
> 	Xm from motif, on a Linux box.
> 
> 	Interfacing to C is simple
> 
> 	.adb
> 	procedure Foo;
> 	pragma Import(C, Foo, "foo");
> 
> 	.c
> 
> 	void foo(void){
> 
> 
> 	gcc -c ada-program.adb ---> ada-program.ali
> 
> 	gcc -c c-program.c  ------> c-program.o
> 
> 	gnatbl name.ali name.o
> 
> 	but how do I link with motif, or whatever?
-- 
Jesus M. Gonzalez Barahona         | addr.:  c/ Butarque, 15
Grupo de Sistemas y Comunicaciones |         28911 Leganes, Spain
Departamento de Informatica        | tel: +34 1 624 94 58
Universidad Carlos III de Madrid   | fax: +34 1 624 94 30
e-mail: jgb@gsyc.inf.uc3m.es       | www: http://www.gsyc.inf.uc3m.es/~jgb




  parent reply	other threads:[~1997-05-08  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-08  0:00 Help! --Interfacing GNAT 3.05 to C libraries Manuel A. Fernandez Fernandez
1997-05-08  0:00 ` billimad
1997-05-08  0:00 ` Jesus M. Gonzalez [this message]
1997-05-08  0:00   ` Geert Bosch
1997-05-09  0:00     ` Stephen Leake
1997-05-10  0:00       ` Geert Bosch
replies disabled

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