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: a07f3367d7,701cccda09aefd03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!wn14feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: 459143320@att.net@worldnet.att.net (anon) Subject: Re: ada import c function Reply-To: anon@anon.org (anon) References: <6568256f-39cd-4757-a630-fe6e4a9a82fc@l16g2000pra.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Tue, 28 Apr 2009 23:08:35 GMT NNTP-Posting-Host: 12.64.12.142 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1240960115 12.64.12.142 (Tue, 28 Apr 2009 23:08:35 GMT) NNTP-Posting-Date: Tue, 28 Apr 2009 23:08:35 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5604 Date: 2009-04-28T23:08:35+00:00 List-Id: there are basically two ways gcc -c imported_function.c -o imported_function.o gnat make use_of_import.adb gnat bind use_of_import.ali gnat link use_of_import.ali imported_function.o or the quick way gcc -c imported_function.c -o imported_function.o gnat make use_of_import.adb -largs imported_function.o In <6568256f-39cd-4757-a630-fe6e4a9a82fc@l16g2000pra.googlegroups.com>, "s. ashen" writes: >Does anyone import C function to ada?? >Using gnat 3.15, i try to compile the example which contain two files > use_of_import.adb > >procedure Use_Of_Import is > procedure Imported_Function; > pragma Import (C, Imported_Function, "imported_function"); >begin > Imported_Function; >end Use_Of_Import; > > imported_function.c > >#include >imported_function () >{ > printf ("\nI am now in the imported function\n\n"); >} > >does anyone know how to compile this program, i had tried many in many >ways, but i can't do this.. always occurred some errors.