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
- Microsoft DirectX SDK . I used the Version from April 2008, but newer ones should work also. (Link to Version June 2008)
- Windows SDK. I use the Version Windows SDK for Windows Server 2008 and .NET Framework 3.5. This is also available as an ISO Image
Wired but true, the Windows SDK does not compile. It is somehow broken. You need to do the following:
Add the following line
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 “
- Add “
C:\Programme\Microsoft SDKs\Windows\v6.1\Lib” to variable “
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 shellStart the “Visual C++ command shell”. If variables should not be in right order for some reason you can achieve the same by doing
%PROGRAMFILES%\Microsoft Visual Studio 8\VC\vcvarsall.bat x86
phonon.bat if not done already, as described above. Then call configure
in the Qt directory.
configure -platform win32-msvc2005 -phonon
Change to the directories
nmake in both.
You should end up with phonon.dll and phonon_ds94.dll (in directory “plugins\phonon_backend”).