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-Thread: 103376,60beaed5c57d54d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!feeder.news.orange.fr!not-for-mail Date: Wed, 23 Mar 2011 09:45:41 +0100 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr-FR; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Import pragma question References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d89b338$0$5392$ba4acef3@reader.news.orange.fr> NNTP-Posting-Date: 23 Mar 2011 09:45:44 CET NNTP-Posting-Host: 83.199.35.154 X-Trace: 1300869944 reader.news.orange.fr 5392 83.199.35.154:16242 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:18398 Date: 2011-03-23T09:45:44+01:00 List-Id: Alex, > I've never interfaced Ada with other languages, so I have some > questions about pragma Import. How does an import pragma know where to > find the non-Ada code to be used for the import? By passing the corresponding object file or library to the linker. No magic! With GNAT you can use: $ gnat make main.adb -largs -lmylib And possibly the PATH to this library with -L//. Where mylib.a (or mylib .dll or .so) contains the symbols from the foreign language. Another option is to a add a pragma Linker_Options into one of the sources. pragma Linker_Options ("-lmylib"); Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net - http://v2p.fr.eu.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver keys.gnupg.net --recv-key F949BD3B