From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7599 invoked by alias); 26 Sep 2005 13:33:03 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 7568 invoked by uid 22791); 26 Sep 2005 13:32:58 -0000 Received: from c-24-61-23-223.hsd1.ma.comcast.net (HELO cgf.cx) (24.61.23.223) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 26 Sep 2005 13:32:58 +0000 Received: by cgf.cx (Postfix, from userid 201) id B050713C0C1; Mon, 26 Sep 2005 13:32:56 +0000 (UTC) Date: Mon, 26 Sep 2005 13:40:00 -0000 From: Christopher Faylor 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: <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 X-SW-Source: 2005-09/txt/msg00892.txt.bz2 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/