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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,76f120be5d26bfd8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-21 15:18:49 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Interfacing C and Ada95 Date: 21 Oct 2003 23:16:40 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1066774728 27081 62.49.19.209 (21 Oct 2003 22:18:48 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 21 Oct 2003 22:18:48 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:1336 Date: 2003-10-21T23:16:40+01:00 List-Id: Stephen Leake writes: > Antonio Mart�nez writes: > > > Now, if I add the 5th line in the file > > paquete.adb, which contains put_line("Hello"), the gcc says ... > > paquete.o(.text+0x10): In function `sumtwo': > > > > : referencia a `ada__text_io__put_line__2' sin definir > > collect2: ld devolvi� el estado de salida 1 > > This is an installation problem; the linker can't find the gnat > libraries. No, it's that he's using plain gcc to link rather than gnat tools. This works for me (after including adainit(), adafinal() as a previous poster suggested): smaug.pushface.org[9]$ gnatmake -c paquete gcc -c paquete.adb smaug.pushface.org[10]$ gnatbind -n paquete.ali smaug.pushface.org[11]$ gnatlink paquete.ali progC.o smaug.pushface.org[12]$ ./paquete Hello 3 + 2 = 5 -- Simon Wright 100% Ada, no bugs.