微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Qt应用未定义对“ gst_app_src_push_buffer”的引用

如何解决Qt应用未定义对“ gst_app_src_push_buffer”的引用

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

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

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

某些信息:

* .pro文件

  • 配置+ = 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"


任何帮助都会得到帮助。

解决方法

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

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

只需添加:

LIBS += lgstapp-1.0

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。