QT GStreamer Windows linker problems

QT GStreamer Windows linker problems

本文关键字:problems linker Windows GStreamer QT      更新时间:2023-10-16

>我正在尝试编译并运行 gstreamer-good-plugin 中提供的 qml-sink 示例(QT 示例(。但是目前我在编译期间收到很多未定义的引用错误。链接器似乎没有正确链接库。 我已经检查了链接库的列表,从我的角度来看,列出了所有需要的库。

例如gst_object_ref、gst_init、...未定义。

我的设置:

  • 视窗 10
  • Qt 5.11
  • Gstreamer 1.0
  • Gstremer devel 1.0
  • 流媒体插件好

从这里安装了 GStreamer 版本:GStreamer 下载 => gstreamer-1.0-devel-x86_64-1.14.3.msi 和 gstreamer-1.0-x86_64-1.14.3.msi

谁能帮我,我该如何解决这个问题?

错误跟踪:

"C:Program FilesCMakebincmake.exe" --build . --target all
"C:Program FilesCMakebincmake.exe" -HC:gst-plugins-good-1.14.4testsexamplesqtqmlsink -BC:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe --check-build-system CMakeFilesMakefile.cmake 0
"C:Program FilesCMakebincmake.exe" -E cmake_progress_start C:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-VorgabeCMakeFiles C:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-VorgabeCMakeFilesprogress.marks
D:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilesMakefile2 all
mingw32-make.exe[1]: Entering directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
D:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilesqml-example.dirbuild.make CMakeFiles/qml-example.dir/depend
mingw32-make.exe[2]: Entering directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
"C:Program FilesCMakebincmake.exe" -E cmake_depends "MinGW Makefiles"                         
C:gst-plugins-good-1.14.4testsexamplesqtqmlsink C:gst-plugins-good-1.14.4testsexamplesqtqmlsink C:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe 
C:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe C:gst-plugins-good-1.14.4testsexamplesqtbuild-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-VorgabeCMakeFilesqml-example.dirDependInfo.cmake --color=
mingw32-make.exe[2]: Leaving directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
D:/Qt/Tools/mingw530_32/bin/mingw32-make.exe -f CMakeFilesqml-example.dirbuild.make CMakeFiles/qml-example.dir/build
mingw32-make.exe[2]: Entering directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
[ 25%] Linking CXX executable qml-example.exe
"C:Program FilesCMakebincmake.exe" -E cmake_link_script CMakeFilesqml-example.dirlink.txt --verbose=1
"C:Program FilesCMakebincmake.exe" -E remove -f CMakeFilesqml-example.dir/objects.a
D:QtToolsmingw530_32binar.exe cr CMakeFilesqml-example.dir/objects.a @CMakeFilesqml-example.dirobjects1.rsp
D:QtToolsmingw530_32bing++.exe    -Wl,--whole-archive CMakeFilesqml-example.dir/objects.a -Wl,--no-whole-archive  -o qml-example.exe -Wl,--out-implib,libqml-example.dll.a -Wl,--major-image-version,0,--minor-image-version,0 
@CMakeFilesqml-example.dirlinklibs.rsp
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x2b): undefined reference to `gst_object_ref'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x87): undefined reference to `gst_object_unref'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0xa7): undefined reference to `operator delete(void*)'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0xc8): undefined reference to `operator delete(void*)'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0xf3): undefined reference to `gst_element_set_state'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x150): undefined reference to `gst_init'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x17d): undefined reference to `gst_pipeline_new'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x194): undefined reference to `gst_element_factory_make'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x1ab): undefined reference to `gst_element_factory_make'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x1c2): undefined reference to `gst_element_factory_make'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x203): undefined reference to `g_assertion_message_expr'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x208): undefined reference to `gst_bin_get_type'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x217): undefined reference to `g_type_check_instance_cast'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x23e): undefined reference to `gst_bin_add_many'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x25f): undefined reference to `gst_element_link_many'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x37f): undefined reference to `g_assertion_message_expr'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x3a1): undefined reference to `g_object_set'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x3ad): undefined reference to `operator new(unsigned int)'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x3f6): undefined reference to `gst_element_set_state'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x401): undefined reference to `gst_object_unref'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x41e): undefined reference to `gst_deinit'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x467): undefined reference to `operator delete(void*)'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text$_ZN5QListIP7QObjectE13detach_helperEi[__ZN5QListIP7QObjectE13detach_helperEi]+0x8c): undefined reference to `__cxa_begin_catch'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text$_ZN5QListIP7QObjectE13detach_helperEi[__ZN5QListIP7QObjectE13detach_helperEi]+0xa3): undefined reference to `__cxa_rethrow'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.text$_ZN5QListIP7QObjectE13detach_helperEi[__ZN5QListIP7QObjectE13detach_helperEi]+0xaa): undefined reference to `__cxa_end_catch'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$_ZTI10SetPlaying[__ZTI10SetPlaying]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$_ZTI9QRunnable[__ZTI9QRunnable]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.eh_frame$_ZN5QListIP7QObjectED1Ev+0x13): undefined reference to `__gxx_personality_v0'
CMakeFilesqml-example.dir/objects.a(main.cpp.obj):main.cpp:(.eh_frame$_ZN5QListIP7QObjectE13detach_helperEi+0x13): undefined reference to `__gxx_personality_v0'
CMakeFilesqml-example.dir/objects.a(qrc_qml.cpp.obj):qrc_qml.cpp:(.eh_frame+0x8b): undefined reference to `__gxx_personality_v0'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [qml-example.exe] Error 1
mingw32-make.exe[1]: *** [CMakeFiles/qml-example.dir/all] Error 2
CMakeFilesqml-example.dirbuild.make:112: recipe for target 'qml-example.exe' failed
mingw32-make.exe[2]: Leaving directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
CMakeFilesMakefile2:66: recipe for target 'CMakeFiles/qml-example.dir/all' failed
mingw32-make.exe[1]: Leaving directory 'C:/gst-plugins-good-1.14.4/tests/examples/qt/build-qmlsink-Desktop_Qt_5_11_1_MinGW_32bit-Vorgabe'
Makefile:82: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

看起来您正在为窗口构建。 我在 Windows 上编译 qml 插件的唯一方法是使用提供的 .pro 文件使用 qmake。 我使用Qt提供的mingw工具链进行编译的实验没有成功,因为GStreamer和Qt之间的ABI不匹配C++。我最终使用MSVC/Visual Studio进行编译。

对 g_/gst_ 的未定义引用可能意味着您的系统上没有正确设置 pkg 配置。pkg-config.exe --modversion gstreamer-1.0应输出您安装的 GStreamer 版本。

你从哪里下载GStreamer的? GStreamer版本到底是什么? 您是下载二进制文件还是自己编译的?