On 12/6/05, Branko Čibej <brane@xbc.nu> wrote:
> Ivan Zhakov wrote:
> > On 12/6/05, Branko Čibej <brane@xbc.nu> wrote:
> >
> >> libsvn_subr.def:
> >>
> >> ...
> >> EXPORTS
> >> ...
> >> svn_ctype_table DATA
> >> ...
> >>
> >> No source-level decoration is necessary.
> >>
> > Yes, but in this case *some* test fails! I can't figure why. But if
> > declare svn_ctype_table with __declspec(dllexport) everything works
> > OK.
> >
> Now, that _is_ funny. I wonder what's going on...
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.
--
Ivan Zhakov
Received on Wed Dec 7 13:09:23 2005