From: "Rego, P." <pvrego@gmail.com>
Subject: Using dll from a C# code
Date: Wed, 29 Feb 2012 03:52:48 -0800 (PST)
Date: 2012-02-29T03:52:48-08:00 [thread overview]
Message-ID: <3622013.252.1330516368698.JavaMail.geo-discussion-forums@ynkz21> (raw)
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?
next reply other threads:[~2012-02-29 11:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 11:52 Rego, P. [this message]
2012-02-29 20:00 ` Using dll from a C# code Shark8
2012-03-01 2:26 ` Rego, P.
2012-03-01 5:38 ` Gautier write-only
2012-03-01 11:41 ` Rego, P.
2012-03-01 13:16 ` Georg Bauhaus
2012-03-01 14:38 ` gautier_niouzes
2012-03-01 15:15 ` Rego, P.
2012-03-01 16:24 ` Gautier write-only
2012-03-02 20:03 ` Rego, P.
2012-03-01 16:25 ` Georg Bauhaus
2012-03-02 21:15 ` Rego, P.
2012-03-02 3:37 ` mjamesb
2012-03-02 21:17 ` Rego, P.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox