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,3b06f2a3754e334e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GPS example fails to compile References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1150952409 12.201.97.176 (Thu, 22 Jun 2006 05:00:09 GMT) NNTP-Posting-Date: Thu, 22 Jun 2006 05:00:09 GMT Date: Thu, 22 Jun 2006 05:00:09 GMT Xref: g2news2.google.com comp.lang.ada:4894 Date: 2006-06-22T05:00:09+00:00 List-Id: Xcriber51 wrote: > > Any patient soul out there to explain how the f--- Ada does binding with > an external language module? (Not the "pragma import" construct, dammit, > but how the whole thing comes together.) When you import a subprogram from another language, you're going outside the Ada language, so the compiler can't help you. You've entered the realm of unchecked programming, where you're telling the compiler, "Trust me." (Of course, decades of experience with languages like C show that, for anything significant, we can't be trusted.) At link time, you have to provide the linker with the implementation of the imported operation so your program can call it. Ada provides pragma Linker_Options for that. With gnatmake, you can use -largs to provide linker options, or use the project-file mechanism. -- Jeff Carter "To Err is human, to really screw up, you need C++!" St�phane Richard 63