PKCONFIG does not work with Qt - Trying to link QtGStreamer-1.0
-
Hey I am trying to developer a Qt Video player application, which will utilise Qt5Gstreamer.
But when I try to use PKGCONFIG, I get this output:Project ERROR: QtGStreamer-1.0 development package not found
I have added the following to the .pro file:
CONFIG+=link_pkgconfig
PKGCONFIG+=QtGStreamer-1.0And when I run
pkg-config --libs Qt5GStreamer-1.0
gives this output:-lQt5GStreamer-1.0 -lQt5GLib-2.0 -lQt5Core
and
pkg-config --cflags Qt5GStreamer-1.0
gives this output:/Qt5GStreamer -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/qt5/QtCore -I/usr/include/qt5
So from what I can tell, the environment, is setup as it should be. So can anyone tell me what is wrong?
I am using Fedora 21, if that helps.Thanks in advance
- Lars
EDIT:
I have also tried, to added the following, to the project file instead of pkg-config:INCLUDEPATH +=
pkg-config --cflags Qt5GStreamer-1.0
LIBS +=pkg-config --libs Qt5GStreamer-1.0
Also to no avail
-
Did dyou install the -devel package: qt-gstreamer-devel or qt5-gstreamer-devel?
-
@Huulivoide Yes I have installed both
-
Did you notice you have
QtGStreamer-1.0
in the .pro file but
Qt5GStreamer-1.0
in your commandline commands.Do other libraries work with PKGCONFIG field?
-
@Huulivoide sorry my bad, it is because I have tried with both Qt and Qt5, and yes other libraries work.
-
@tools
I'm having the same problem
How do you did ? Do you add these lines?CONFIG += link_pkgconfig
PKGCONFIG += Qt5GStreamer-1.0
INCLUDEPATH += -pthread -I/usr/local/include/Qt5GStreamer -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/qt5/QtCore -I/usr/include/qt5Thank you
-
I was having the same issue. I found that using the "LIBS" variable, instead of using:
"CONFIG += link_pkgconfig
PKGCONFIG += ..."
worked for me. So you put "LIBS += -lQt5GStreamer-1.0 -lQt5GStreamerUi-1.0" and whatever other libraries you need. If the library files are in an unusual place, you can use "LIBS += -L" followed by the directory. I'm not sure if it matters, but I'm using QMake version 3.0 and Qt Creator 4.0.0.