comp.lang.ada
 help / color / mirror / Atom feed
From: billimad@vanuata.dcs.gla.ac.uk (billimad)
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: <5ksp4n$9ba@singer.cent.gla.ac.uk> (raw)
In-Reply-To: 33719153.6BCC@laurel.datsi.fi.upm.es


>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 but how do I link with motif, or whatever?

First, you'll need to write your own Ada bindings to the X routines
(Xm, Xlib, etc). Alternatively, you can use bindings, such as those
from Intermetrics, already in existance.

GNAT must be able to find the source files for units that are needed by
the unit being compiled. You do this by including command line options
to gnatbl telling the linker the location of these files that it will
require.

-Idir (that's upper case i) appends directory dir to the list of
directories searched for files to include in the linking.

-Ldir appends directory dir to the list of directories to be searched
for -l (that's lower case L) options.

-l (that's lower case L) tells the linker program to use the named
library when linking.

If you use the Intermetrics bindings and these are located in /X11/Ada
and the standard C X11 library is in /usr/X11/lib (for example) then

gcc -c helloworld.adb
gnatbl helloworld.ali -I/X11/Ada -L/usr/X11/lib -lX11
                       ^ upper case i            ^ lower case L

Try the manual entry for gcc, and have a look at
http://ocsystems.com/xada/
(The Free X11/Ada 95 Programmer's Home Page).

Andy




      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 ` Jesus M. Gonzalez
1997-05-08  0:00   ` Geert Bosch
1997-05-09  0:00     ` Stephen Leake
1997-05-10  0:00       ` Geert Bosch
1997-05-08  0:00 ` billimad [this message]
replies disabled

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