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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Interfacing Ada with C Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0ee9eec7-6024-4fb8-8df0-f65c146e4b84@i28g2000yqa.googlegroups.com> <143ef70b-7e74-426b-a621-a5fd157849be@x21g2000yqa.googlegroups.com> <18zszx6sjlloa$.k5nohxp9k27i$.dlg@40tude.net> <91c174e6-c359-4bf5-b284-d93a725ad09d@c10g2000yqi.googlegroups.com> <0dadd6b6-452d-43e9-b0b9-374b5106b298@t2g2000yqe.googlegroups.com> <4acf7f59-2675-4498-8d95-35d01bc1e3af@j8g2000yqd.googlegroups.com> Date: Sun, 25 Jul 2010 19:06:54 +0200 Message-ID: <1vcstpdax6vxp$.1umnj0p2l8a32$.dlg@40tude.net> NNTP-Posting-Date: 25 Jul 2010 19:06:55 CEST NNTP-Posting-Host: e970e174.newsspool2.arcor-online.net X-Trace: DXC=CGf016@cHD@m;jA9EHlD;3Ycb4Fo<]lROoRa8kF On Sun, 25 Jul 2010 09:18:41 -0700 (PDT), Ada novice wrote: > So I compile > > gnatmake -c imsl.adb > gnatmake -c testmatrix.adb gnatmake testmatrix.adb - > And then work on the .ali files > > gnatbind -n imsl.ali testmatrix.ali > > I'll need a C file to do the linking. What to put in the C file? C files or library files? With C files you do: gcc -c c_file.c gnatmake -c main_ada_file.adb gnatbind main_ada_file.ali gnatlink main_ada_file.ali c_file.o With library files (import or object) it is simpler gnatmake main_ada_file.adb --largs library_file.lib (If you have only a shared library then it would require a bit more work.) Better to create a gpr file for the binding and another one for the project that uses them. With gpr files you can use GPS (GNAT IDE) as well as command line: gnatmake -Pproject_file.gpr >> Personally I'd have called Internal imsl_f_eig_gen if only so I'd >> remember what was what! but YMMV. > > Do you mean renaming the procedure imsl.adb to Internal > imsl_f_eig_gen.adb . Sorry this part is not clear to me. Simon meant to name function Internal rather imsl_f_eig_gen. It is a matter of style. I agree it would be better. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de