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
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”).
My post was about Visual Studio 2005. With 2008 nothing needs to be self compiled, since Nokia ships the Qt binaries already.
If you have a particular problem with Qt and 2005 it would be necessary to know what your problem is about.
CAn i use instead of Visual c++ 2008 extended any other produkt like Visual Studio 2005 prof ?
@Peter: I am getting the same problem. Did u get any solution?
Actually “QtGuid4.lib” doesn’t exist.Instead “libQtGuid4.a” exists. So do I have to modify the MAkefile.Debug to correst LIBS, so that it can point to correct library files?
Thanks,
Bhaskar
Thank you for your great how-to! It helped me a lot to getting phonon run on Vista, see here for a “How to compile QT Phonon in Windows Vista”:
http://www.uni-koblenz.de/~snoopy/info/how_to_compile_qt_phonon_in_windows_vista.html
QtCreator is based on mingw, and does not ship with .lib files (this are only generated by nmake).
Also phonon can not be compiled with mingw.
So in your approach you are trying to do something impossible. But if you are having more problems please use one of the available web forums or mailingslists. I cannot supply help in the comment sections.
After running nmake in src/phonon I got these errors:
LINK : fatal error LNK1104: cannot open file ‘c:\Qt\QtCreator\qt\lib\QtGuid4.lib
NMAKE : fatal error U1077: ‘”C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE”‘ : return code ‘0x450’
Stop.
NMAKE : fatal error U1077: ‘”C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe”‘ : return code ‘0x2’
Seems QtGuid4.lib was not found. Please, help me!
I spent *ages* trying to get phonon and phonon_ps9 to build. I finally found this simple “how to” and it worked straight away! Thanks Matthias. Much appreciated. Note I did it with the Nov 2008 DirectX SDK, and Qt 4.4.3.
Darryl