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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,90504b78c9e015b1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news-out2.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Linking with GNAT on Windows Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0ac0e003-176f-48d1-b72f-56f81dae922e@1g2000vbm.googlegroups.com> <69epr50o3g3w$.108hd37jl3fjj$.dlg@40tude.net> <3ade5d53-eedd-4a0e-bf4f-bbf6a62cf997@c3g2000yqd.googlegroups.com> Date: Wed, 25 Nov 2009 10:46:56 +0100 Message-ID: <1tz8hsohppx0j.1sqxhytef0t79.dlg@40tude.net> NNTP-Posting-Date: 25 Nov 2009 10:46:56 CET NNTP-Posting-Host: a4e5dd98.newsspool2.arcor-online.net X-Trace: DXC=_gWR[`7enW;^6ZC`4IXm65S@:3>?PUX6H7:9PP? X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8231 X-Original-Bytes: 2947 Date: 2009-11-25T10:46:56+01:00 List-Id: On Wed, 25 Nov 2009 00:43:11 -0800 (PST), Maciej Sobczak wrote: > On 24 Lis, 18:34, "Dmitry A. Kazakov" > wrote: > >> Hmm, it is no matter how the program is compiled, but how is it linked. > > The GNAT invocation is the same in both cases and includes this: > > -largs -lmylibrary Usually debug/release versions have different names like mylibraryd.lib or else placed into different subdirectory like .\Debug vs. .\Release. What about the "-L" switch? > with mylibrary.lib (the result of compilation on Visual Studio) file > somewhere around. > >> Of course we cannot exclude that some inspired C programmer > > I was that programmer. The whole C library amounts to a single > function with single line of code ("Hello from C", essentially), no > preprocessor and no other tricks. The function is declared as extern > "C" to avoid name mangling. OK, extern "C" normally mangles, e.g. adds underscore in front of the name. Also, if I correctly remember, stdcall convention adds some funny suffixes like "@4" to the names in import libraries. But that behavior is independent on debug/release. I think you should: 1. Remove all instances of mylibrary.lib. 2. Build it anew. 3. Ensure that GNAT links the library you have built. 4. If error persists, view the lib file. Compare names there and the unresolved references reported by GNAT. (There exist plug-ins for Window commander to list the entry points of a library.) >> AFAIK, GNAT does not recognize the MS lib files, > > It seems to recognize them. Yes, you are right. I forgot that. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de