关于在Linux中配置.pro文件以运行GStreamer的信息很多,但是在Windows中做同样的事情似乎非常困难。我从官方网站下载了Gst并运行了安装程序,现在位于D:\gstreamer\1.0\x86...我找到了唯一一个尝试更改qt .pro文件的人的描述,我照着做了:
INCLUDEPATH += c:/gstreamer/1.0/x86/include \
c:/gstreamer/1.0/x86/include/gstreamer-1.0/gst \
c:/gstreamer/1.0/x86/include/glib-2.0\
c:/gstreamer/1.0/x86/include/glib-2.0/glib \
c:/gstreamer/1.0/x86/lib/glib-2.0/include
LIBS += -Lc:/gstreamer/1.0/x86/lib
CONFIG += c:/gstreamer/1.0/x86/lib/pkgconfig
这个项目提供了在输入"gst_init()"等GStreamer相关代码时的辅助,但是会报错:
"gst_init"未定义的引用
现在的问题是如何在Windows上连接GStreamer?
#include <QCoreApplication>
#include <gst/gst.h>
int main(int argc, char *argv[])
{
gst_init(NULL,NULL);
//g_print("abc");
return 0;
}
"C:/Qt/Qt5.1.1/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug 进入目录 'D:/Projects/AllTests/Qt/build-Console-Desktop_Qt_5_1_1_MinGW_32bit-Debug' g++ -Wl,-subsystem,console -mthreads -o debug\Console.exe debug/main.o -Lc:/gstreamer/1.0/x86/lib -LC:\Qt\Qt5.1.1\5.1.1\mingw48_32\lib -lQt5Cored debug/main.o: In function
main': D:\Projects\AllTests\Qt\build-Console-Desktop_Qt_5_1_1_MinGW_32bit-Debug/../Console/main.cpp:8:
未定义的引用 to
gst_init' collect2.exe: 错误: ld 返回了 1
退出状态 Makefile.Debug:77: recipe for target 'debug\Console.exe'
失败 mingw32-make[1]: * [debug\Console.exe] Error 1
离开目录 'D:/Projects/AllTests/Qt/build-Console-Desktop_Qt_5_1_1_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed mingw32-make: *
[debug] Error 2 00:20:18: 进程 «C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe» 完成,返回代码 2。"注:此段内容为编译错误信息,可能是由于缺少某些库文件导致的。