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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71ea647f36e7583b,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-04 13:59:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news1.carrier1.net!teaser.fr!enst!enst.fr!not-for-mail From: "Alexandre E. Kopilovitch" Newsgroups: comp.lang.ada Subject: GNAT and a very foreign DLL Date: Sat, 5 Jan 2002 01:04:04 +0300 (MSK) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: avanie.enst.fr 1010181542 13096 137.194.161.2 (4 Jan 2002 21:59:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 4 Jan 2002 21:59:02 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Mailer: Mail/@ [v2.44 MSDOS] Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18565 Date: 2002-01-05T01:04:04+03:00 A winter evening, GNAT 3.13p on Windows, and some apparently exotic foreign DLL, which was written in C or C++ and now should be called from an Ada program. The problem appears to be with the combination of the call convention and the names of the DLL's entry points: the call convention is surely Stdcall, but the entry point names do not contain usual suffixes "@nn" - they look as common C identifiers. I looked into GNAT docs, and saw that although the review of the call conventions and the entry point naming strategies is quite comprehensive, not all possible combinations are supported with the pragmas. In particular, it seems that the combination of the Stdcall convention and the entry point name without "@nn" isn't supported - nether External_Name nor Link_Name nor other (linker's) options can help. As the Stdcall convention is unavoidable anyway, I was forced to create some "post-linker", which post-processes my executable, replacing "@" in the DLL's entry point names by zero bytes. After that post-processing all works fine, but I surely don't want to distribute such a "technology". So my question is: did I missing something in GNAT docs? Is there some regular way to specify within an Ada program _any_ name for a DLL's entry point, regardless of a call convention? By the way, the DLL in the case has an additional strange feature: the *.lib for it, which is built with the Microsoft tool (according to the instructions in the GNAT docs) doesn't work (linker doesn't resolve the external references to the DLL's entry points). But the lib*.a created with the gnatdll using the same *.def file works fine. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia