#
Building libsndfile on Win32

Note : For pre-compiled binaries for windows, see the main web page.

There are currently two ways of building libsndfile under Win32:

- Using the free MinGW tools.
- Using Cygwin (this is the full Cygwin without the -mno-cygwin option).

Building libsndfile using the microsoft compiler does not currently work. Microsoft's compiler is a C++ compiler and does not compile a number of ISO C99 Standard constructs. If you insist on compiling libsndfile with the microsoft compiler you are on your own.

However, even though the libsndfile source code cannot be compiled with the microsoft compiler, the pre-compiled windows DLL distributed on the main web page can be used with C++ projects compiled with the microsoft compiler.

The free MinGW tools are the preferred option because they are a free (as in beer and speech), easily obtainable and much closer to the Linux/GCC environment on which libsndfile is developed.

##
Building libsndfile using MinGW.

The MinGW tools are available from http://www.mingw.org/. The files you will need will be named something like:

- msysDTK-1.0.1.exe
- MSYS-1.0.10.exe
- gcc-core-3.4.2-20040916-1.tar.gz
- gcc-g++-3.4.2-20040916-1.tar.gz
- binutils-2.15.91-20040901-1.tar.gz
- mingw-runtime-3.9.tar.gz
- w32api-3.6.tar.gz
- mingw-utils-0.3.tar.gz

They should be installed using the directions on the MinGW site. I know the instructions aren't great, but I don't have the time or expertise to write better ones.

Once you have the tools installed you will get an icon named MSYS on your desktop. Clicking on that icon will bring up something that looks a little like an xterm.

Assuming that you have downloaded the .tar.gz file into the C:\temp\ directory you should now be able to execute the following commands:

    		tar zxf /c/temp/libsndfile.X.Y.Z.tar.gz
    		cd libsndfile-X.Y.Z
    		./configure
    		make
    		make check

If there is a failure during compiling or the "make check" stage, you should check that you are using the current stable version of the MinGW tools, and the latest version of libsndfile before sending the author a bug report.

Once this is done, anyone interested in using libsndfile in other projects will be interested in the following files:

- libsndfile.dll
- libsndfile.lib
- libsndfile.def
- src/sndfile.h
- doc/*.html

##
Compile Problems

Compile problems using the above method of building the libsndfile DLL on Win32 should be emailed to Erik de Castro Lopo.

If you are using some other method to compile the libsndfile DLL you are on your own.