This is the mail archive of the cygwin@sourceware.cygnus.com
mailing list for the Cygwin project. See the Cygwin
home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]
Re: How to handle variables (data, etc.) in DLLs?
- To: DJ Delorie <dj@delorie.com>
- Subject: Re: How to handle variables (data, etc.) in DLLs?
- From: T J Harding <tjh@quadstone.com>
- Date: Thu, 04 Mar 1999 09:31:53 +0000
- CC: cygwin@sourceware.cygnus.com
- Delivered-To: listarch-cygwin@sourceware.cygnus.com
- Delivered-To: mailing list cygwin@sourceware.cygnus.com
- Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
- Organization: Quadstone
- References: <36DD41B4.BF1C00D7@quadstone.com> <199903031619.LAA28028@envy.delorie.com>
- Sender: cygwin-owner@sourceware.cygnus.com
- Sender: tjh@quadstone.com
DJ Delorie wrote:
> DLLs *can't* export "data". They can only export pointers to data,
> which is what they do. In older gccs, you'll need to do something
> like this:
>
> extern int *__imp_foo;
> #define foo (*__imp_foo)
>
> In newer gccs, do something like this:
>
> extern int foo __attribute__((dllimport));
>
> These tell gcc to dereference the imported pointer, rather than
> thinking it's the data itself.
Thanks, that's useful to know (although there are about 250 of these
data symbols in the code!). I'd need to brush up on my C++ (yes, this
is actually C++ code) to figure out what's required.
Tim
begin:vcard
n:Harding;Tim
tel;cell:+44 961 444986
tel;fax:+44 131 220 4492
tel;work:+44 131 220 4491
x-mozilla-html:TRUE
url:www.quadstone.com
org:Quadstone
adr:;;16 Chester Street;Edinburgh;Scotland;EH3 7RA;United Kingdom
version:2.1
email;internet:tjh@quadstone.com
title:Decisionhouse Services
x-mozilla-cpt:;-1080
fn:Tim Harding
end:vcard
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com