我已经安装的Gstreamer SDK,并试图编译这段代码:
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
int main (int argc, char *argv[])
{
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMediaMapping *mapping;
GstRTSPMediaFactory *factory;
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
server = gst_rtsp_server_new ();
mapping = gst_rtsp_server_get_media_mapping (server);
factory = gst_rtsp_media_factory_new ();
gst_rtsp_media_factory_set_launch (factory,
"( videotestsrc is-live=1 ! x264enc ! rtph264pay )");
gst_rtsp_media_factory_set_shared (factory, TRUE);
gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);
g_object_unref (mapping);
gst_rtsp_server_attach (server, NULL);
g_main_loop_run (loop);
return 0;
}
我有喜欢同样的错误这个问题 ,
在功能`主:
。测试launch01.c :(文本+ 0x64):未定义参照
。`gst_rtsp_server_new”测试launch01.c :(文字+ 0x74):未定义
参考`gst_rtsp_server_get_media_mapping”
测试launch01.c :(文本+ 0x7d):未定义参考
。`gst_rtsp_media_factory_new”测试launch01.c :(文字+位0x95):未定义
参考`gst_rtsp_media_factory_set_shared”
测试launch01.c :(文本+写入0xAD):未定义参考
`gst_rtsp_media_factory_set_launch”测试launch01.c :(文字+ 0xc9):
未定义的参考`gst_rtsp_media_mapping_add_factory”
测试launch01.c :(文本+ 0xe9):未定义参考
`gst_rtsp_server_attach” collect2:LD返回1个退出状态
我使用Qt Creator和这里是我的.pro文件:
QT + =芯
QT - = GUI
TARGET = GStreamer的CONFIG + =控制台CONFIG - = app_bundle
CONFIG + = link_pkgconfig
PKGCONFIG + = gstreamer的-0.10
模板=应用
SOURCES + = main.cpp中
INCLUDEPATH + = /home/kato/ew-gst-sdk-linux-x86_64-2012.03-0/include/gstreamer-0.10
INCLUDEPATH + = /usr/include/glib-2.0 INCLUDEPATH + = /usr/lib/x86_64-linux-gnu/glib-2.0/include INCLUDEPATH + =在/ usr /包括/ libxml2的
LIBS + = -L /家庭/加藤/ EW-GST-SDK-Linux的x86_64-2012.03-0 / lib目录\ -lgstreamer-0.10 \ -lgstrtsp-0.10
AM链接到pkg-config gstreamer-rtsp-0.10 --libs
正确?
我得到了同样的错误。