Cannot find -lQt5Multimedia
I'm trying to get the Qt examples related to multimedia/video working.
- Ubuntu 14.04
- Qt Creator 3.4.1 and Qt 5.4.2 (GCC 4.6.1, 64 bit)
I copied the examples from the installation path:
cp -r /opt/Qt5.4.2/Examples/Qt-5.4/multimediawidgets/ ~/qt_examples
I try to compile the videowidget example, I did not modify a single line in the project, here is the error:
/usr/bin/ld: cannot find -lQt5Multimedia collect2: error: ld returned 1 exit status make: *** [videowidget] Error 1 18:17:01: Le processus "/usr/bin/make" s'est terminé avec le code 2. Erreur lors de la compilation/déploiement du projet videowidget (kit : Desktop) When executing step "Make"
Here are the libraries that I have:
$ dpkg -L libqt5multimedia5 /. /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libQt5Multimedia.so.5.2.1 diverted by libqt5multimedia5-touch to: /var/lib/libqt5multimedia5-touch-diverted/libQt5Multimedia.so.5.2.1.diverted-libqt5multimedia5-touch /usr/share /usr/share/doc /usr/share/doc/libqt5multimedia5 /usr/share/doc/libqt5multimedia5/changelog.Debian.gz /usr/share/doc/libqt5multimedia5/copyright /usr/lib/x86_64-linux-gnu/libQt5Multimedia.so.5.2 diverted by libqt5multimedia5-touch to: /var/lib/libqt5multimedia5-touch-diverted/libQt5Multimedia.so.5.2.diverted-libqt5multimedia5-touch /usr/lib/x86_64-linux-gnu/libQt5Multimedia.so.5 diverted by libqt5multimedia5-touch to: /var/lib/libqt5multimedia5-touch-diverted/libQt5Multimedia.so.5.diverted-libqt5multimedia5-touch
I tried to add
INCLUDEPATH += /usr/lib/x86_64-linux-gnu/in the .pro file, it doesn't change anything.
How do I install Qt with multimedia support, or how do I get this example working?
Looks like it's trying to use your system's version of Qt instead of the one you have in /opt/Qt5.4.2. Is Qt 5.4.2 listed in QtCreator in Tools->Options->Build & Run? If not, add it and use the Build kit that uses this Qt version.
Colonel of Siberia
INCLUDEPATH need for your .h files.
You can try add to your .pro file path to Qt libs:
LIBS += -L /path_to_qt_libs/ -l lib_filename.so
Thanks for your answers; the problem was indeed the default configuration, my mistake was trusting the information in the "About panel" of Qt Creator; you also have to make sure you have chosen Qt 5.4.2 as the default configuration, just like on the image below: (Tools > Options > Build & Run > Kits > Make the right one the default)
Now the compilation runs fine and the program launches.