Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Getting dynamic loading to work on cygwin



Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author