comp.lang.ada
 help / color / mirror / Atom feed
* Using dll from a C# code
@ 2012-02-29 11:52 Rego, P.
  2012-02-29 20:00 ` Shark8
  2012-03-02  3:37 ` mjamesb
  0 siblings, 2 replies; 14+ messages in thread
From: Rego, P. @ 2012-02-29 11:52 UTC (permalink / 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?



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-03-02 21:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 11:52 Using dll from a C# code Rego, P.
2012-02-29 20:00 ` 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.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox