comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: calling Ada dll from C?
Date: Sat, 21 Mar 2015 14:19:28 +0000
Date: 2015-03-21T14:19:28+00:00	[thread overview]
Message-ID: <lysicyv3f3.fsf@pushface.org> (raw)
In-Reply-To: 85d2428z3e.fsf@stephe-leake.org

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> 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.

You need to build a 'stand-alone library'[1]. If the library is dynamic,
the default is to do automatic initialization (i.e. elaboration) on load
(and finalization on unload?).

[1] http://docs.adacore.com/gprbuild-docs/html/share/gnat_project_manager.html#stand-alone-library-projects

  reply	other threads:[~2015-03-21 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-21  9:43 calling Ada dll from C? Stephen Leake
2015-03-21 14:19 ` Simon Wright [this message]
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
replies disabled

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