Wine on Windows
Building wine with mingw on Windows
The wine wiki says wine builds somewhat with mingw,
so I gave it a shot on a windows 7 box:
"make depend" alone takes fifteen minutes.
- mingw has a nice installer now; I installed the 'mingw developer
(i.e. downloaded and ran the latest installer from
and checked 'mingw developer toolkit' )
- in cmd, did
to create msys user directory
- Got a wine source tree (e.g. by doing
git clone git://source.winehq.org/git/wine.git wine-git
in a cygwin window.)
- In the msys window started in #2, did
./configure --without-x --without-freetype
If make fails early with an odd error about mode_t already being defined,
you may have interrupted configure so that it didn't generate a proper
include/config.h. You can recover by running
If make fails with "libd3dcompiler.a: no such file or directory",
you may have hit bug
29569, try inserting the missing dll/ in four lines in Makefile, e.g.
sed -i 's,$(LN_S) ,$(LN_S)/dlls' Makefile
Building Wine with Visual Studio 2005 on Windows
The wine wiki says wine builds somewhat with Visual Studio,
so I gave it a try on a windows 7 box. Here's a recipe that kind of works:
Even though Visual Studio doesn't successfully build wine, it's
close enough to let the PVS-Studio static analyzer try to analyze
wine's source code.
- Configure wine using mingw as described above
- Build tools/winebuilder with mingw (i.e. in an msys window,
do "cd tools/winebuilder; make")
then create tools/winebuilder/Output/Win32_Debug and copy winebuild.exe
there. This is only needed because msvcmaker doesn't generate a project for
- Verify that include/config.h is more than 81 lines long (it should be
about 1300 lines long). If it's short, run
in an msys window to regenerate it.
- Work around the lack of unistd.h in visual C++
by creating include/unistd.h that just has the two lines
typedef int ssize_t;
since mingw puts read() and write() in unistd.h, but visual c++ puts them
in io.h. (The right way to fix this might be to make the unistd.h includes
conditional on HAVE_UNISTD_H, but then I don't know where ssize_t would
- Run tools/winapi/msvcmaker to generate the .dsp and .dsw
files. You may need to apply the patch from
to get this to not complain about uninitialized variables.
Make sure you're not in Visual Studio when you do this, or the files might
not get updated.
- In a CMD window, make sure midl.exe is on the PATH, then start Visual
- In Visual Studio 200x, load wine.dsw.
The IDE will convert all .dsw/.dsp files to .sln/.vcproj files.
The .dsw and .dsp files are then no longer used.
(Always do this when starting the IDE. If you try to reuse the
.sln/.vcproj files on the next IDE session, it barfs and says there is
an invalid XML character, at least with Visual Studio 2005 Express.)
- Right click on one of the subprojects and build it. The first
couple build ok, but advapi32 and rpcrt4 fail to build.
- msvcmaker seems to leave a 'lib' prefix and a _a suffix on
the names of static libraries, and this confuses visual studio.