mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-24 02:19:51 +00:00
160 lines
5.2 KiB
HTML
160 lines
5.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
<TITLE>
|
|
Building libsndfile on Win32
|
|
</TITLE>
|
|
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
|
<LINK REL=StyleSheet HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
<!-- pepper -->
|
|
<H1><BR>Building libsndfile on Win32</H1>
|
|
|
|
<P>
|
|
There are currently two ways of building libsndfile under Win32:
|
|
</P>
|
|
<UL>
|
|
<LI> Using the free <A HREF="#MinGW">MinGW</A> tools.
|
|
<LI> Using Microsoft's own <A HREF="#MSVC">Visual C++</A> tools.
|
|
</UL>
|
|
|
|
<P>
|
|
The free MinGW tools are the preferred option because they are a free (as in
|
|
beer and speech), easily obtainable and much closer the the Linux/GCC
|
|
environment on which libsndfile is developed.
|
|
At some time in the near future I intend to drop support for Microsoft's
|
|
tools.
|
|
Yes, I know there is now a free (as in beer, but not as in speech) version
|
|
of Microsoft's tools, but I believe that the only reason Microsoft released
|
|
these free tools was because of the growing popularity of the MinGW tools.
|
|
</P>
|
|
|
|
<A NAME="MinGW"></A>
|
|
<H2><BR>Building libsndfile using MinGW.</H2>
|
|
<P>
|
|
The MinGW tools are available from <A HREF="http://www.mingw.org/">
|
|
http://www.mingw.org/</A>.
|
|
The files you will need will be named something like:
|
|
</P>
|
|
<UL>
|
|
<LI> msysDTK-1.0.1.exe
|
|
<LI> MSYS-1.0.10.exe
|
|
<LI> gcc-core-3.3.1-20030804-1.tar.gz
|
|
<LI> gcc-g++-3.3.1-20030804-1.tar.gz
|
|
<LI> binutils-2.13.90-20030111-1.tar.gz
|
|
<LI> mingw-runtime-3.2.tar.gz
|
|
<LI> w32api-2.5.tar.gz
|
|
</UL>
|
|
|
|
<P>
|
|
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.
|
|
</P>
|
|
|
|
<P>
|
|
Once you have the tools installed you will get an icon named <B>MSYS</B> on
|
|
your desktop.
|
|
Clicking on that icon will bring up something that looks a little like an
|
|
xterm.
|
|
</P>
|
|
|
|
<P>
|
|
Assuming that you have downloaded the <B>.tar.gz</B> file into the
|
|
<B>C:\temp\</B> directory you should now be able to execute the following
|
|
commands:
|
|
</P>
|
|
|
|
<PRE>
|
|
tar zxf /c/temp/libsndfile.X.Y.Z.tar.gz
|
|
cd libsndfile-X.Y.Z
|
|
./configure
|
|
make
|
|
make check
|
|
</PRE>
|
|
|
|
<P>
|
|
which will result in ????????????????????
|
|
</P>
|
|
|
|
<!--===========================================================================-->
|
|
|
|
<A NAME="MSVC"></A>
|
|
<H2><BR>Building libsndfile using MSVC++ 6.</H2>
|
|
<P>
|
|
For Win32 there is a Microsoft Visual C++ compatible makefile in the <B>Win32\</B>
|
|
directory of the distribution. Building the libsndfile DLL on Win32 involves
|
|
the following:
|
|
</P>
|
|
<!-- pepper -->
|
|
<OL>
|
|
<LI> Using WinZip in the GUI, open the libsndfile-1.X.Y.tar.gz file and
|
|
extract the files into a directory. The following example assumes
|
|
<B>C:\</B>.
|
|
<LI> In the directory containing the extracted files, find the file
|
|
<B>Win32\Makefile.msvc</B> and open it in a text editor (ie Notepad or
|
|
similar).
|
|
<LI> Find the line which starts with <B>MSVCDir</B> and modify the directory
|
|
path to point to the location of MSVC++ on your machine. This allows the
|
|
makefile to inform the compiler of the location of the standard header
|
|
files. Note that none of the directory names are allowed to have spaces
|
|
in them.
|
|
<LI> Copy the file named <B>sndfile.h</B> from the <B>Win32\</B> directory to the
|
|
<B>src\</B> directory replacing the one that was originally there.
|
|
<LI> Copy the file named <B>config.h</B> from the <B>Win32\</B> directory to the
|
|
<B>src\</B> directory replacing the one that was originally there.
|
|
<LI> Open a DOS window and cd into the libsndfile-1.X.Y directory.
|
|
<LI> Make sure that the program <B>nmake</B> (which is part of the MSCV++
|
|
package) is in a directory which is part of your <B>PATH</B> variable.
|
|
<LI> Type in the command
|
|
<CENTER><PRE>C:\libsndfile-1.X.Y> nmake -f Win32\Makefile.msvc
|
|
</PRE></CENTER>
|
|
and press <return>. You should now see a a large number of compile
|
|
commands as libsndfile.dll is built.
|
|
<LI> To check that the built DLL has been compiled correctly type in and run the
|
|
command
|
|
<CENTER><PRE>C:\libsndfile-1.X.Y> nmake -f Win32\Makefile.msvc check
|
|
</PRE></CENTER>
|
|
which will compile a set of test programs and run them. If any of the
|
|
programs fail the error message will be helpful in debugging the problem.
|
|
</OL>
|
|
<!-- pepper -->
|
|
<P>
|
|
At the end of the above procedure, you will find the DLL, <B>libsndfile.dll</B> and a
|
|
LIB file <B>libsndfile.lib</B> in the current directory. These two files, along
|
|
with the header file <B>sndfile.h</B> (in the <B>Win32\</B> directory) are all that
|
|
you need to copy to your project in order to use libsndfile.
|
|
</P>
|
|
<!-- pepper -->
|
|
<H2><BR>Compile Problems</H2>
|
|
<!-- pepper -->
|
|
<P>
|
|
Compile problems using the above method of building the libsndfile DLL on Win32 should
|
|
be emailed to
|
|
<A HREF="mailto:erikd@zip.com.au">Erik de Castro Lopo</a>.
|
|
This includes error messages generated during step 7 above.
|
|
</P>
|
|
<!-- pepper -->
|
|
<P>
|
|
If you are using some other method to compile the libsndfile DLL you are on your own.
|
|
</P>
|
|
<BR>
|
|
<!-- pepper -->
|
|
<!-- pepper -->
|
|
<!-- pepper -->
|
|
<!-- pepper -->
|
|
|
|
</BODY>
|
|
</HTML>
|
|
|
|
<!--
|
|
Do not edit or modify anything in this comment block.
|
|
The arch-tag line is a file identity tag for the GNU Arch
|
|
revision control system.
|
|
|
|
arch-tag: b32ddb11-eb51-425f-9d39-b8b66284f129
|
|
-->
|