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: jgb@gsyc.inf.uc3m.es (Jesus M. Gonzalez) Subject: Re: Help! --Interfacing GNAT 3.05 to C libraries Date: 1997/05/08 Message-ID: #1/1 X-Deja-AN: 240224988 Sender: jgb@hola.gsyc.inf.uc3m.es References: <33719153.6BCC@laurel.datsi.fi.upm.es> Organization: GSYC, Univ. Carlos III Madrid, Spain. Newsgroups: comp.lang.ada Date: 1997-05-08T00:00:00+00:00 List-Id: "Manuel A. Fernandez Fernandez" 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