WineBuild/WineLib <-> MFC

jaymz at jaymz at
Thu Dec 5 05:23:20 CST 2002

Going further into the MFC dll handling, I raised the following issue:

I have two dynamic libs ( and, both loaded by 
the wrapper (
The problem is that global or static class variables are badly exported 
from to

Here's an example:
In, let assume that I export a global integer variable named 

I add @ extern myVar myVar in mfc.dll.spec.
When I do a GetProcAddress of myVar from the wrapper, the returned 
address is good, but when I link my application, myVar is undefined 
(WineBuild did not include it in myapp.dll.spec.c).

If I add instead in the spec file something like @ stdcall myVar() 
myVar, it's still good when using GetProcAdress, I can now link my 
application, but at runtime, the address of the variable is not the good 
one, so I'm using corrupted data ! Therefore, when the app runs, all 
static data are in fact not or badly initialized and it crashes.

What's the exact syntact to correctly export class static variable from 
a dll ?
Thanks a lot for your attention.

More information about the wine-devel mailing list