Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm Sender: cygwin-owner@sourceware.cygnus.com Delivered-To: mailing list cygwin@sourceware.cygnus.com Date: Wed, 3 Mar 1999 11:19:18 -0500 Message-Id: <199903031619.LAA28028@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj@envy.delorie.com using -f From: DJ Delorie To: tjh@quadstone.com CC: cygwin@sourceware.cygnus.com In-reply-to: <36DD41B4.BF1C00D7@quadstone.com> (message from T J Harding on Wed, 03 Mar 1999 14:05:40 +0000) Subject: Re: How to handle variables (data, etc.) in DLLs? References: <36DD41B4.BF1C00D7@quadstone.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