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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!postnews.google.com!b15g2000yqd.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Linking with GNAT on Windows Date: Wed, 25 Nov 2009 04:47:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <8aed937b-b11f-422a-95d3-5fb5d7645e39@b15g2000yqd.googlegroups.com> References: <0ac0e003-176f-48d1-b72f-56f81dae922e@1g2000vbm.googlegroups.com> <69epr50o3g3w$.108hd37jl3fjj$.dlg@40tude.net> <3ade5d53-eedd-4a0e-bf4f-bbf6a62cf997@c3g2000yqd.googlegroups.com> <1tz8hsohppx0j.1sqxhytef0t79.dlg@40tude.net> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1259153244 12218 127.0.0.1 (25 Nov 2009 12:47:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 25 Nov 2009 12:47:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b15g2000yqd.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8233 Date: 2009-11-25T04:47:24-08:00 List-Id: On 25 Lis, 10:46, "Dmitry A. Kazakov" wrote: > 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? If the file was not found, the linker would say so. Every -lmylibrary option must have a corresponding library file. > 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. Well, no. :-) As already said, this is the interaction between Visual Studio and MinGW, so can be completely reproduced outside of GNAT. The problem proved to be related to the Visual optimization option that is used to enable so-called whole-program optimization (Enable link-time code generation). On command-line this is /GL option. This option must be switched off. I hope this observation will help other programmers. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada