PDA

View Full Version : How to make QtMultimedia work on Windows using MSVC



Sergex
2nd May 2013, 16:57
Hello,

I have been using QtMultimedia perfectly fine when I downloaded the minGW version of Qt5 on windows, but I had to switch and use the MSVC version and now I cannot make QtMultimedia to work.

I have added QT += multimedia to my .pro file and at least auto-completion works when I type #include <someMULTIMEDIA class>

Is there something that I am missing ? Is it “normal” that it doesn’t work now that I am using MSVC as a compiler.

Any help greatly appreciated.

wysota
2nd May 2013, 18:49
I have added QT += multimedia to my .pro file and at least auto-completion works
So what exactly "doesn't work" then?

Sergex
2nd May 2013, 20:05
Well, it doesn't compile actually, I get the error:
C:\Qt\dev\Projects\TestDev\mainwindow.cpp:3: error: C1083: Cannot open include file: ‘QAudioInput’: No such file or directory

This was not happening when I was using the minGW version of Qt..

wysota
2nd May 2013, 20:43
"It" meaning your project? Do you have a QAudioInput file installed? Where does it reside relative to your Qt installation directory?

Sergex
3rd May 2013, 13:49
Yes, the project won't compile.

I have my directory like this:

C:\Qt\Qt5.0.2\5.0.2\msvc2010\include\QtMultimedia

In there I have all the header files that I need, QAudioInput, QAudioFormat, etc..

And in :
C:\Qt\Qt5.0.2\5.0.2\msvc2010\lib

I have the installed libraries of the whole framework.

d_stranz
3rd May 2013, 18:45
Apparently you haven't told MSVC where to find the QtMultimedia directory.

After modifying your .pro file, did you re-create the MSVC .vcproj file from it? (Using the Qt add-in for MSVC?) This should add the QtMultimedia directory to the set of locations to look for header files.

Otherwise, you can simply #include each required header as


#include <QtMultimedia/QAudioInput>