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,97cf8dc45eee6abf X-Google-Attributes: gid103376,public From: billimad@vanuata.dcs.gla.ac.uk (billimad) Subject: Re: Help! --Interfacing GNAT 3.05 to C libraries Date: 1997/05/08 Message-ID: <5ksp4n$9ba@singer.cent.gla.ac.uk>#1/1 X-Deja-AN: 240296469 References: <33719153.6BCC@laurel.datsi.fi.upm.es> X-Authenticated: billimad on POP host vanuata.dcs.gla.ac.uk Organization: University of Glasgow X-Posted-From: InterNews 1.0.4@soay.dcs.gla.ac.uk Newsgroups: comp.lang.ada Date: 1997-05-08T00:00:00+00:00 List-Id: >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