Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 26 Sep 2005 09:32:56 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Visibility of compiler symbols between executables and DLLs
Message-ID: <20050926133256.GD27224@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <dcb629180509260139f2440c1@mail.gmail.com> <279601c5c27a$cc315170$5304a8c0@chimaera> <4337C029.5786F209@dessent.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4337C029.5786F209@dessent.net>
User-Agent: Mutt/1.5.8i

On Mon, Sep 26, 2005 at 02:32:25AM -0700, Brian Dessent wrote:
>Max Bowsher wrote:
>
>> I'm fairly sure that it is impossible. Actually, it might be possible if
>> there was a flag to convice GCC to add an import table to the built .exe,
>> but last time I investigated that, there was no such flag. But even if that
>> was possible, the .dll would need to explicitly link against the .exe that
>> was to load it, for this method to work.
>
>This does actually work, AFAIK.  You need to use __declspec(dllexport)
>on the symbols in the .exe, and produce an import library
>(-Wl,--out-implib) when building the .exe which is then used in linking
>the .dll.  It hardcodes the name of the .exe in the .dll though, so it
>also means that you cannot use the .dll as a general purpose library.

Right on both counts.  This isn't impossible.  It's just not really convenient/useful.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

