From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22863 invoked from network); 2 Jun 2000 15:40:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Jun 2000 15:40:49 -0000 Received: (qmail 25235 invoked by alias); 2 Jun 2000 15:40:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11731 Received: (qmail 25228 invoked from network); 2 Jun 2000 15:40:40 -0000 X-Authentication-Warning: bloodbath.burble.org: pixi set sender to pixi@bloodbath.burble.org using -f To: Peter Stephenson Cc: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: Getting dynamic loading to work on cygwin References: <0FVJ00HEB8D918@la-la.cambridgesiliconradio.com> From: pixi@burble.org (maurice s. barnum) Date: 02 Jun 2000 08:16:15 -0700 In-Reply-To: Peter Stephenson's message of "Fri, 02 Jun 2000 16:00:46 +0100" Message-ID: User-Agent: Gnus/5.0806 (Gnus v5.8.6) XEmacs/21.2 (Molpe) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Peter Stephenson writes: : > If I recall correctly, there is no way to export data references; only : > subroutines entry points can be exported. I.e. one DLL cannot directly : > reference variable in other DLL. But I may be wrong. : : Yuk, it looks like your right. Using dlsym to get the symbol works OK, but : simply linking against the DLL and loading it doesn't seem to pick up the : right value. That will screw up a lot of things. Data references can be imported on Win32, but you need help from the compiler to generate an extra indirection on access to the imported data. This of course implies that the compiler needs to know what data is being imported, which with normal Win32 compilers is indicated by decorating the extern declaration with '__import' or '__declspec(dllimport)'. I don't have cygwin or it's documentation handy, so I don't know if gcc supports this or some alternate spelling. --xmsb