c++linuxqtgstreamer

Qt app undefined reference to `gst_app_src_push_buffer'


I'm creating a Qt application which will show a video which is more or less based on the following code: https://gist.github.com/floe/e35100f091315b86a5bf

When I'm running it as it is at C file it's working, but when I try to move it to my Qt app, I get undefined reference to `gst_app_src_push_buffer' (and 'collect2:error: ld returned 1 exit status').

But among all the methods mention in the "template" I'm using, this is my only error.

SOME INFO:

*.pro file:

Includes:

Compilation output:


/home/ido/Qt/5.15.0/gcc_64/bin/qmake -o Makefile ../gstest/gstest.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
g++ -Wl,-rpath,/home/ido/Qt/5.15.0/gcc_64/lib -o gstest main.o mainwindow.o moc_mainwindow.o   -L/usr/lib/x86_64-linux-gnu/gstreamer-1.0/ -lgstapp -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 /home/ido/Qt/5.15.0/gcc_64/lib/libQt5Widgets.so /home/ido/Qt/5.15.0/gcc_64/lib/libQt5Gui.so /home/ido/Qt/5.15.0/gcc_64/lib/libQt5Core.so -lGL -lpthread   
mainwindow.o: In function `prepare_buffer(_GstAppSrc*)':
/home/ido/build-gstest-Desktop_Qt_5_15_0_GCC_64bit-Debug/../gstest/mainwindow.cpp:62: undefined reference to `gst_app_src_push_buffer'
Makefile:287: recipe for target 'gstest' failed
collect2: error: ld returned 1 exit status
make: *** [gstest] Error 1
17:46:32: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project gstest (kit: Desktop Qt 5.15.0 GCC 64bit)
When executing step "Make"


Any help will be much appreciated.


Solution

  • gstapp probably does not exists with that name. Use pkg-config for that as well:

    PKGCONFIG += gstreamer-1.0 gstreamer-app-1.0 glib-2.0 gobject-2.0