I've recently updated my Windows dev environment and reminded me of some people having trouble with audio in their builds. There are a few tricks to take into account when building Fuse for Windows so I would like to describe how to setup a native-compile environment.

MinGW is a GNU toolchain (gcc, gdb, binutils, etc) that allows to build native Windows applications. MSYS is a Unix emulation layer and provides common Unix tools like autoconf, sed, perl, etc. As Fuse is being mainly developed in Unix-like OS, MinGW and MSYS provide a straight development environment in Windows.

If you get bored reading this, just jump to the end.

MinGW


Get MinGW from www.mingw.org:

binutils-2.21-3-mingw32-bin

bzip2-1.0.5-2-mingw32-dev

gcc-c++-4.5.2-1-mingw32-bin

gcc-core-4.5.2-1-mingw32-bin

gdb-7.2-1-mingw32-bin

libbz2-1.0.5-2-mingw32-dll-2

libexpat-2.0.1-1-mingw32-dll-1

libgcc-4.5.2-1-mingw32-dll-1

libgmp-5.0.1-1-mingw32-dll-10

libgomp-4.5.2-1-mingw32-dll-1

libiconv-1.13.1-1-mingw32-dll-2

libintl-0.17-1-mingw32-dll-8

libmpc-0.8.1-1-mingw32-dll-2

libmpfr-2.4.1-1-mingw32-dll-1

libpthread-2.8.0-3-mingw32-dll-2

libssp-4.5.2-1-mingw32-dll-0

libstdc++-4.5.2-1-mingw32-dll-6

mingwrt-3.18-mingw32-dev

mingwrt-3.18-mingw32-dll

pexports-0.44-1-mingw32-bin

w32api-3.17-2-mingw32-dev

Unpack all the files into to c:\dev\mingw

Other requirements


Get some GTK utils from www.gtk.org:

gettext-runtime_0.18.1.1-2_win32

glib_2.26.1-1_win32

pkg-config_0.25-1_win32

Unpack all the files into to c:\dev\mingw

Get DirectX 6 development headers from libsdl (www.libsdl.org/extras/win32/cygwin). Put the headers into c:\dev\mingw\include and skip libraries. Alternatively you could get DirectX 7 header files from mplayer (www.mplayerhq.hu/MPlayer/contrib/win32).

MSYS


Get MSYS files from www.mingw.org:

autoconf-2.67-1-msys-1.0.15-bin

automake-1.11.1-1-msys-1.0.13-bin

bash-3.1.17-4-msys-1.0.16-bin

bison-2.4.2-1-msys-1.0.13-bin

bzip2-1.0.5-2-msys-1.0.13-bin

coreutils-5.97-3-msys-1.0.13-bin

cygutils-1.3.4-4-msys-1.0.13-bin

cygutils-dos2unix-1.3.4-4-msys-1.0.13-bin

diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin

findutils-4.4.2-2-msys-1.0.13-bin

flex-2.5.35-2-msys-1.0.13-bin

gawk-3.1.7-2-msys-1.0.13-bin

gettext-0.17-2-msys-1.0.13-bin

gettext-0.17-2-msys-1.0.13-dev

grep-2.5.4-2-msys-1.0.13-bin

groff-1.20.1-2-msys-1.0.13-bin

gzip-1.3.12-2-msys-1.0.13-bin

less-436-2-msys-1.0.13-bin

libcrypt-1.1_1-3-msys-1.0.13-dll-0

libexpat-2.0.1-1-msys-1.0.13-dll-1

libgettextpo-0.17-2-msys-dll-0

libiconv-1.13.1-2-msys-1.0.13-dev

libiconv-1.13.1-2-msys-1.0.13-dll-2

libintl-0.17-2-msys-dll-8

libltdl-2.4-1-msys-1.0.15-dev

libltdl-2.4-1-msys-1.0.15-dll-7

libpopt-1.15-2-msys-1.0.13-dll-0

libregex-1.20090805-2-msys-1.0.13-dll-1

libtermcap-0.20050421_1-2-msys-1.0.13-dll-0

libtool-2.4-1-msys-1.0.15-bin

m4-1.4.14-1-msys-1.0.13-bin

make-3.81-3-msys-1.0.13-bin

man-1.6f-2-msys-1.0.13-bin

msysCORE-1.0.16-1-msys-1.0.16-bin

msysCORE-1.0.16-1-msys-1.0.16-ext

patch-2.6.1-1-msys-1.0.13-bin

perl-5.6.1_2-2-msys-1.0.13-bin

rxvt-2.7.2-3-msys-1.0.14-bin

sed-4.2.1-2-msys-1.0.13-bin

tar-1.23-1-msys-1.0.13-bin

termcap-0.20050421_1-2-msys-1.0.13-bin

Package selection is rather personal. Unpack all the files into to c:\dev\msys and launch c:\dev\msys.bat. The Windows folder c:\dev\msys equivals to linux folder /usr

Edit /etc/fstab and create a mount point:

c:/dev/mingw /mingw

Export some variables into /home/user/.profile (or whatever your Windows username is):

export CPPFLAGS=-I/local/include

export LDFLAGS=-L/local/lib

Launch a new msys.bat to refresh variables.

Fuse dependencies


Get Fuse dependencies from their official site:

audiofile-0.2.7 (source)

libgcrypt-1.4.6 (source)

libgpg-error-1.9 (source)

libpng-1.5.2 (source)

libxml2-2.7.7 (source)

zlib125-dll (compiled DLL)

libspectrum (source)

fuse (source)

Unpack all the files into c:\dev\msys\src

zlib


Unpack some files to:

/usr/local/bin/zlib1.dll

/usr/local/include/zconf.h

/usr/local/include/zlib.h

We reuse binary dll mantaining binary compatibility:

pexports /usr/local/bin/zlib1.dll > /usr/local/lib/zlib.def

dlltool -def /usr/local/lib/zlib.def -dllname zlib1.dll -output-lib /usr/local/lib/libz.dll.a

audiofile


cd audiofile-0.2.7

./configure

make

make install

strip /usr/local/bin/libaudiofile-0.dll

cd ..

libgcrypt


cd libgpg-error-1.9

./configure

make

make install-strip

cd ..

cd libgcrypt-1.4.6

./configure

make

make install

strip /usr/local/bin/libgcrypt-11.dll

cd ..

libxml2


cd libxml2-2.2.7

./configure

make

make install-strip

cd ..

libpng


cd libpng-1.5.2

./autogen.sh

./configure

make

make install-strip

libspectrum


cd libspectrum

./configure -without-glib

make

make install-strip

cd ..

Fuse


cd fuse

./configure -with-win32 -without-glib

make

make install-strip

cd ..

ALL IN ONE


If you want to do a quick test and don't mess with downloads and settings, you could try this dev package (36Mb packed, 268Mb unpacked):

http://www.fileserve.com/file/2dp6vGH

Create the folder c:\dev and unpack the 7z file directly into that directory. Then rename c:\dev\msys\home\user to whatever your Windows username is and launch c:\dev\msys\msys.bat. The Windows folder c:\dev\msys equivals to Linux directory /usr