On Dec 7, 2005, at 7:08 AM, Ivan Zhakov wrote:
> I have discovered problems:
> http://msdn2.microsoft.com/en-us/library/619w14ds.aspx
> In a few words: On Windows exporting variable means exporting
> *pointer* to this variable and importing must dereference it.
> __declspec(dllexport)/__declspec(dllimport) makes this automatically.
> So I see several ways:
> 1. Use __declspec(dllimport) for variables only. Causes special define
> for *each* dll to separate dll building dll from importing.
> 2. Use __declspec(dllimport) everywhere on windows -- anyway causes
> usage special define per library and change signature of all API.
> 3. Never export/import data between libraries. I don't sure that this
> can be done.
We use a utility program to generate the list of exports and then
specify explicitly those things we do (or don't) want exported. This
file is passed to the linker (.def). We find this preferable to
littering header files with tons of declspec cruft.
Timothy Wall
Oculus Technologies Corporation
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 7 14:25:16 2005