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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eed2d3a237734411 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Shared library project Date: Thu, 10 Jun 2010 20:53:01 +0100 Organization: A noiseless patient Spider Message-ID: References: <9dcc29a0-fb04-4a2a-9f3a-1678a509358c@o4g2000vbo.googlegroups.com> <22fd730b-88c1-4d04-9eaf-8c21d802faec@t10g2000yqg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 10 Jun 2010 19:53:01 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="14214"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WJVYW+8v6lmiMcZQ7UlxvXBbpf5U96Hg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin) Cancel-Lock: sha1:spbCXzJBp+kiuuYa9gXFziQ8/Yw= sha1:tLJ4kKWbc94GDJHoZguh9s4NVTo= Xref: g2news2.google.com comp.lang.ada:12582 Date: 2010-06-10T20:53:01+01:00 List-Id: "Yannick DuchĂȘne (Hibou57)" writes: > I am bit surprised, as it should be possible to build a DLL using > static library. Unfortunately, I have never experimented this with > GNAT. Anyway, feel free to give more details. Like I said above, provided you compile the static library in such a way that it can be used in a dynamic context. With some systems this would mean you had to compile the static library with -fPIC (position-independent code). I expect that what's happening is that - in systems where it's needed - GNAT is supplying this flag automatically for the dynamic library and not for the static library. So on those systems linking the dynamic library against static objects wouldn't work and is disallowed. And in the interests of portability it's disallowed even on systems where there's no need for such a flag. But I don't know.