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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: calling Ada dll from C? Date: Sat, 21 Mar 2015 14:19:28 +0000 Organization: A noiseless patient Spider Message-ID: References: <85d2428z3e.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="639fc80d983459c1c824f7cd3788af8d"; logging-data="9409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uHftlf5ucDWI+Koxd5hAamwhOSbTTPlg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:A3mmKbeSNy4zNMYFWgWWPxyXp2M= sha1:Wpyobg3E0RYVGWeNbgrs6zaDxx0= Xref: news.eternal-september.org comp.lang.ada:25218 Date: 2015-03-21T14:19:28+00:00 List-Id: Stephen Leake 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