The original documentation of Trolltech was not sufficient to get me compile the phonon.dll and phonon_ds94.dll under Windows XP. Therefore you find here a description of what I did to get it compile.

I use Visual Studio 2005 and the corresponding nmake compiler. The description here thus relates to this compiler. If it works the same with the 2008 Version I do not know. I did not test mingw, but since the Qt docs itself say that the phonon library is not compatible with mingw that does not make much sense. I do not use Windows 2000 nor Vista. So I do not know what is necessary in such cases.

[TOC]

Installation of SDKs

First of all one needs additional SDKs for the compilation, which are not bundled with Visual Studio. These are

Patch SDKs

Wired but true, the Windows SDK does not compile. It is somehow broken. You need to do the following:

Add the following line

#include "rpcsal.h"

to linenumber 32 in files

  • C:\Programme\Microsoft SDKs\Windows\v6.1\Include\medparam.h
  • C:\Programme\Microsoft SDKs\Windows\v6.1\Include\mediaobj.h

Change System Variables

These variables need to be set, otherwise Visual C++ does not find the header and library files.

  • Add “C:\Programme\Microsoft SDKs\Windows\v6.1\Include” to variable “INCLUDE“.
  • Add “C:\Programme\Microsoft SDKs\Windows\v6.1\Lib” to variable “LIB

phonon.bat

Some Variables need to be set before compilation. The easiest way is to create a phonon.bat file that can be executed before one starts configure.

"%PROGRAMFILES%\Microsoft DirectX SDK (April 2007)\utilities\bin\dx_setenv.cmd"
%PROGRAMFILES%\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd

The last one should only be necessary if you use the Express Version, but it is no problem if is called anyway

Visual C++ command shell

Start the “Visual C++ command shell”. If variables should not be in right order for some reason you can achieve the same by doing
  • Start cmd.exe
  • Run phonon.bat
  • run %PROGRAMFILES%\Microsoft Visual Studio 8\VC\vcvarsall.bat x86

Configure

Run phonon.bat if not done already, as described above. Then call configure

configure -platform win32-msvc2005 -phonon
in the Qt directory.

Compilation

Change to the directories

  • src/phonon
  • src/plugins/phonon

and call nmake in both.

You should end up with phonon.dll and phonon_ds94.dll (in directory “plugins\phonon_backend”).