comp.lang.ada
 help / color / mirror / Atom feed
* calling Ada dll from C?
@ 2015-03-21  9:43 Stephen Leake
  2015-03-21 14:19 ` Simon Wright
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Leake @ 2015-03-21  9:43 UTC (permalink / raw)


I'm using an OpenToken parser with Emacs. In order to make it as fast as
possible, I'm trying to build the parser as a dynamically linked library
(.dll or .so); Emacs 25 will have the ability to load dlls at run time.

I can build the dll with a library project file:

   for Library_Name use "ada_wisi_module_parse";
   for Library_Dir use "lib";
   for Library_Kind use "dynamic";

However, when I try to load that dll into Emacs, it complains with "the
module cannot be found". Of course, it doesn't say _which_ module cannot
be found - sigh.

I get the same error on Windows 7 32 bit and Debian 64 bit. I'm
compiling with GNAT GPL 2014.

On Debian, ldd says all required libraries are found.


A related issue is 'adainit'. According to "(gnat_ugn) Binding with
Non-Ada Main Programs", since the main program is not in Ada, I'm
supposed to run gnatbind with -n, and then call 'adainit' from the C
main program.

However, since I'm only building a dll, not a main program, it appears
gnatbind is not run, so no 'adainit' is generated.


Has anyone build an Ada dll that can be called from C?

-- 
-- Stephe

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

end of thread, other threads:[~2015-03-25 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21  9:43 calling Ada dll from C? Stephen Leake
2015-03-21 14:19 ` Simon Wright
2015-03-23  7:23   ` Stephen Leake
2015-03-23  8:36     ` Dmitry A. Kazakov
2015-03-23 13:42     ` Patrick Noffke
2015-03-25 20:48     ` Stephen Leake

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