How to port c++ program to linux using winelib

Eric Frias efrias at
Mon Oct 18 14:22:36 CDT 2004

From: "Boaz Harrosh" <boaz at>
> <>Not happy and is a bit out of dated but it Looks it could still work
> today.
> [...]

Thanks for the suggestion!  Even if it isn't elegant, it sounds like it will
work (and is very close to what we were doing with the older wine).  I might
even be able to coax our build system into generating all of the *_export()
and using_dlls() functions automatically.

> But be careful with this approach. It is an order of a magnitude slower
> on load time than DLL linkage on windows. I came to a dead end with one
> of my projects, where I managed to compile and run every thing but I had
> to revert to PE compiled code because it took my app 4-6 minutes to
> load. (PE takes 40 seconds). It was a 1.2 M lines of C++ code divided in
> to 37 DLLs + MFC in a dll.

I'm working on a large project too, well over a million lines as reported by
'wc -l'.  We've got about 50 shared libraries, but only 10 of those use
wine; the rest are entirely native.  We think our application takes too long
to load, but not nearly 4-6 minutes.  On a fast machine if you run it a few
times in a row, it takes around 8 seconds to load.  On a lesser machine that
has been doing other things, it will often take 40 seconds or so.  I'm not
really sure where all of the time is spent.  I've been assuming that the
majority of it is spent by  Most of the DLLs have 200-300 symbols
imported from the standard wine libraries, so the whole application is doing
about 3000 fixups in our project. I can't see that taking too long (but I've
never timed it).  I think if I started using the method you suggested, it
should add less than a hundred extra fixups for wine to perform -- we're
really just changing what causes the libraries to load, not what they

Was all of the time your application took to load because of wine's DLL
import mechanism, or because of the shared loader in linux?  One of the
reasons we are trying to upgrade to a more recent version of winelib is so
that we can try some of the 'prelinking' tools to try to make our app load
faster, so I'm curious where all of the time is spent.

> We have talked about the right solution with Alexander on Wineconf. What
> he suggested was:

Thanks for the summaries.


More information about the wine-devel mailing list