Compiling Audacity 1.3.12 on Windows 2000
I'm not a world-class programmer by any stretch of the imagination, but wanting to get involved with Audacity gave me the opportunity to learn a whole lot. One reason for this was the machine I had elected to be used for the developing stuff, quite dated like all my computers and running Windows 2000. Normally the Windows build of Audacity is compiled using Visual Studio 2008 or at least Visual C++ 2008 Express Edition, plus a halfway recent Platform SDK (or Windows SDK as it's called nowadays). None of all this will run on 2000, however. So how does one pull it off anyway? Read on to find out how I did.
Hardware used
Here's the setup, which was my main machine many moons ago until I moved to the duallie realm. It still received the occasional upgrade over the years.
- PIII-800EB on Asus P3B-F
- 384 megs of PC133 SDRAM
- system drive: Seagate Cheetah 36ES 18 GB (ST318406LW) on AHA-2940U2W
- data(/app) drive: WD800JD on Promise Ultra100TX2 via Marvell based SATA adapter
- Fortron FSP300-60PN(PF) PSU
- Samsung 191T (analog) via Sapphire Radeon 9000 64 MiB
- Cherry G80-3456LQMDE
This has a certain geek flair (you don't see the big heatsink and 92 mm fan on the CPU or the system drive decoupling and cooling setup) but would prove a little tight, memory and system drive space in particular. (You normally want some 300 .. 400 megs of free RAM.)
If you want to do yourself a favor, make sure the system is rock solid and shows no memory problems when tested with e.g. Memtest86+. I only found out about two bit errors that had developed in one of the memory modules (the larger one, of course) after I'd ordered and installed an additional one! That left the machine with as much memory as before, but no defective memory cells this time... I promptly recompiled Audacity to make sure that there weren't any errors as a result of the memory problems.
Software used
This is what I ended up using software wise, most of which was installed from scratch (plan on using like 4 or 5 GB in the end, which includes almost 1 gig for Audacity alone):
- Windows 2000 SP4 fully updated (needs IE6, too)
- Visual C++ 2005 Express Edition (which installed .NET Framework 2.0 along the way), plus some Service pack I think – I recommend getting the MSDN package as well
- Platform SDK for Win Server 2003 SP1 (from 2005) – heed the instructions on integrating it with VC++ 2005 Express, in MSDN and also found on the web
- DirectX SDK April 2005 update (for DSound support)
- wxWidgets 2.8.11
- regular Audacity 1.3.12-beta full source tarball (SVN planned for later)
- taglib 1.6.3 (turned out not to be supplied with the above, goof)
- CMake 2.8 (needed for configuring taglib)
- the old Audacity icon (I'd think you can get it from an old pre-1.3-10 source package or from SVN, I had one floating around that I had extracted with ResourceHacker years ago)
- Python 2.6.5 (if you want to build help)
- GNU gettext for Windows (if you want to build i18n files, project "locale")
- Steinberg ASIO SDK (for ASIO support, optional; see Audacity's
compile.txt
)
Some of the above need their paths registered in Visual Studio
(bin
directories can also be appended to the system search
PATH
).
If you disabled 8.3 file name creation for performance reasons using fsutil behavior set disable8dot3 1 in the past, better revert this before getting started. It gave me problems with MS Keyboard Layout Creator 1.3 (compile failed as the path parser in the executable used seems to be of the oldfashioned variety), and I think the problems I initially had when trying to compile wxWidgets also were rooted there.
Getting the system up to date
I had never bothered to update Internet Explorer to version 6.0 on this system, since I don't use IE anyway. No way around it if you want to install VC++ 2005. (Why did they do away with re-opening Explorer windows after a restart? I thought that was a nice feature. Still works with IE5, doesn't with 6.) WSUS Offline proved a useful tool in getting the system updated. Talk about an awful lot of reboots.
Compiling wxWidgets
The usual first step before trying to compile Audacity itself. Since I got
2.8.11 which wasn't officially in use at this time yet (1.3.12 is normally
built using 2.8.10), the supplied modified files were of no use. It turned out
that replacing access.cpp
was no longer necessary (the bug that
had prompted the patch was fixed in 2.8.11), but the setup.h
modification as outlined
in this older version of the "Compiling on Windows" article had to be
carried out. Nothing too much out of the ordinary so far.
Compiling Audacity
Getting Audacity 1.3.12 itself to compile proved to be a bumpy ride. Here's the issues I ran into and how I eventually resolved them.
General issues:
- The library
taglib
is not included with the supposed "full source" even though it must be for the compile to work – seems like an either an oversight or possibly a licensing issue (LGPL vs. GPL). Anyway, I obtained taglib 1.6.3 (which gets a folder underlib-src
) along with the CMake environment for Windows in version 2.8. In the CMake GUI, specify thetaglib
root directory for code andtaglib\taglib
for build. After it's finished configuring, you should have the necessary header files. (Compile will spit out a bunch of warnings, but runs.) - Compiling sub-project
help
requires Python – it was happy with 2.6.5. - Generating locale files (so Audacity will talk to you in your native tongue
if it's not English) requires a utility from GNU gettext. (The generated
Audacity.mo
files seem to be identical to those of a regular 1.3.12 build though, so you might as well copy the "languages" subdirectory from there.)
And now, the inevitable issues related to my Seriously Antiquated Build Environment (SABE):
- Most sub-project
.vcproj
files, as well as the mainAudacity.sln
, need to be hand-patched to be compatible with VC++ 2005 (otherwise they will be refused). Since those are text (XML) files, it's not too hard though – the.sln
needs a format version number of 9.00 rather than 10.00 (and maybe an additional line break at the very beginning), and for the.vcproj
files you merely need to replaceVersion="9.00"
withVersion="8.00"
. For a more comfortable solution, you can also obtain Visual Studio Project Converter. - The fancy Audacity icon introduced in 1.3.10 is in PNG format and will be refused by the resource compiler in VC++ 2005. Obtain an old version of Audacity.ico instead.
- The outdated platform SDK does not include any support for the WASAPI sound
API that was introduced with Vista. As a result, compiling the PortMixer
library will fail, complaining about a missing header file
(
mmdeviceapi.h
). I succeeded by removingpx_win_endpoint.c
from the project, commenting out the following inpx_win_common.c
…if (verInfo.dwMajorVersion >= 6) { return open_ep_mixers(Px, deviceIn, deviceOut); }
…and also commenting out the declaration foropen_ep_mixers()
inpx_win_common.h
. Obviously this means that the build will not work as well on Vista and 7 as the pre-compiled one does.
If you install the DirectX SDK only after you've already tried compiling Audacity, be sure to rebuild PortAudio and PortMixer.
That's it!
All of this took me at least four days. The reader will hopefully succeed a bit more quickly.