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!feeder.eternal-september.org!feeder.erje.net!eu.feeder.erje.net!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: calling Ada dll from C? Date: Sat, 21 Mar 2015 04:43:49 -0500 Message-ID: <85d2428z3e.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) Cancel-Lock: sha1:nr23HsDdLSYDRTbySErHwHrb+IM= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: d8754550d3d59e3fb833012970 X-Received-Bytes: 1719 X-Received-Body-CRC: 1577814975 Xref: news.eternal-september.org comp.lang.ada:25217 Date: 2015-03-21T04:43:49-05:00 List-Id: 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