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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,889b07ac9e6ac6a3,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.133.213 with SMTP id g21mr2916bkt.3.1330516369068; Wed, 29 Feb 2012 03:52:49 -0800 (PST) Path: t13ni83272bkb.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: "Rego, P." Newsgroups: comp.lang.ada Subject: Using dll from a C# code Date: Wed, 29 Feb 2012 03:52:48 -0800 (PST) Organization: http://groups.google.com Message-ID: <3622013.252.1330516368698.JavaMail.geo-discussion-forums@ynkz21> NNTP-Posting-Host: 201.7.145.1 Mime-Version: 1.0 X-Trace: posting.google.com 1330516368 8993 127.0.0.1 (29 Feb 2012 11:52:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Feb 2012 11:52:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=201.7.145.1; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-02-29T03:52:48-08:00 List-Id: Hello, I have a method in C# which I need to export to Ada using a dll. Maybe // simple.cs // compile with csc /t:library simple.cs using System; public class VerifyClass{ public bool Verify(){ return true; } } In order to use the function Verify() in Ada, I need to import this to something like -- simple.ads package Simple is function Verify return Boolean; pragma Import (Convention => dll, Entity => Verify, External_Name => "Verify"); end Simple; And I could use with -- main.adb -- build with gnatmake main -largs -lsimple with Text_IO; use Text_IO; with Simple; use Simple; procedure Main is begin Put_Line (Boolean'Image (Verify)); end Main; When I build the Ada with gnatmake main -largs -lsimple the compiler returns me ./main.o(.text+0xd6):main.adb: undefined reference to `Verify@0' So what have I missed? Maybe the C# code structure should be changed?