【问题标题】:Qt app undefined reference to `gst_app_src_push_buffer'Qt 应用程序未定义对“gst_app_src_push_buffer”的引用
【发布时间】:2020-12-28 01:15:59
【问题描述】:

我正在创建一个 Qt 应用程序,它将显示一个或多或少基于以下代码的视频: https://gist.github.com/floe/e35100f091315b86a5bf

当我在 C 文件中运行它时,它正在工作,但是当我尝试将它移动到我的 Qt 应用程序时,我得到未定义的对 `gst_app_src_push_buffer' 的引用(并且 'collect2:error: ld 返回了 1 个退出状态')。

但在我使用的“模板”中提到的所有方法中,这是我唯一的错误。

一些信息:

*.pro 文件:

  • CONFIG += c++11 link_pkgconfig
  • PKGCONFIG += gstreamer-1.0 glib-2.0 gobject-2.0
  • LIBS += -L/usr/lib/x86_64-linux-gnu/gstreamer-1.0/ -lgstapp

包括:

  • #include "/usr/include/glib-2.0/glib.h"
  • #include
  • #include
  • #include
  • #include
  • #include

(ofc 所有的包含都有他们的 '>' 但由于某种原因,stackoverflow 使它消失了)

编译输出:


/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"


任何帮助将不胜感激。

【问题讨论】:

标签: c++ linux qt gstreamer lib


【解决方案1】:

只需添加:

LIBS += lgstapp-1.0

【讨论】:

    【解决方案2】:

    gstapp 可能不存在该名称。也可以使用pkg-config

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

    【讨论】:

    • 谢谢,就这么简单
    猜你喜欢
    • 2018-12-16
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    • 2015-05-14
    • 1970-01-01
    • 1970-01-01
    • 2014-06-24
    • 1970-01-01
    相关资源
    最近更新 更多