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-7-bit X-Google-Thread: 103376,afaf6b0b4d015191 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-10 14:32:03 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: including C routines in Ada (newbie ask for assistance) Date: 09 May 2001 06:39:34 +0100 Organization: CodeFella Message-ID: References: <3af67ee5.9539925@news.nl.uu.net> NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 989530318 nnrp-02:9786 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 9 May 2001 05:39:34 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: newsfeed.google.com comp.lang.ada:7515 Date: 2001-05-09T05:39:34+00:00 List-Id: serious@clerk.com (Noam Kloos) writes: > Hi Once I had someone show me how to write routines in C and import > them into Ada source with pragma Import(....); > I know how to do a system call pragma import(C,C_System,"system"); but > how do I access a c source file I have written myself? For a start, you write similar pragma Imports for your own functions. Then you have to link against the object files. If you are using GNAT, and you have your main Ada program in foo.adb and your C in bar.c, you would need gcc -c bar.c gnatmake foo -largs bar.o (to start with, it can get more complicated of course!)