How to handle variables (data, etc.) in DLLs?

DJ Delorie dj@delorie.com
Wed Mar 3 08:19:00 GMT 1999


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



More information about the Cygwin mailing list