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: tjh@quadstone.com
- Subject: Re: How to handle variables (data, etc.) in DLLs?
- From: DJ Delorie <dj@delorie.com>
- Date: Wed, 3 Mar 1999 11:19:18 -0500
- CC: cygwin@sourceware.cygnus.com
- Delivered-To: listarch-cygwin@sourceware.cygnus.com
- Delivered-To: mailing list cygwin@sourceware.cygnus.com
- In-reply-to: <36DD41B4.BF1C00D7@quadstone.com> (message from T J Harding onWed, 03 Mar 1999 14:05:40 +0000)
- Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
- References: <36DD41B4.BF1C00D7@quadstone.com>
- Sender: cygwin-owner@sourceware.cygnus.com
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.
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com