Home:ALL Converter>GStreamer - Compiling with RTSP Server

GStreamer - Compiling with RTSP Server

Ask Time:2018-04-19T03:47:50         Author:Shalin Upadhyay

Json Formatter

I'm trying to compile a gstreamer program with rtsp-server. I've included the necessary header files and get this error after trying to compile it.

In function `main':
stream.c:(.text+0x36): undefined reference to `gst_rtsp_server_new'
stream.c:(.text+0x46): undefined reference to `gst_rtsp_server_get_mount_points'
stream.c:(.text+0x4f): undefined reference to `gst_rtsp_media_factory_new'
stream.c:(.text+0x64): undefined reference to `gst_rtsp_media_factory_set_launch'
stream.c:(.text+0x75): undefined reference to `gst_rtsp_media_factory_set_shared'
stream.c:(.text+0x8a): undefined reference to `gst_rtsp_mount_points_add_factory'
stream.c:(.text+0xa7): undefined reference to `gst_rtsp_server_attach'
collect2: error: ld returned 1 exit status

I've tried compiling the program a few different ways based on:

Gst RTSP server programming

Gstreamer rtsp server linking in Qt Creator

The exact gcc commands I've used are:

gcc stream.c -o stream `pkg-config --cflags --libs gstreamer-rtsp-1.0 gstreamer-1.0`

and

gcc `pkg-config gstreamer-1.0 gstreamer-rtsp-1.0 --cflags` stream.c -o stream `pkg-config gstreamer-1.0 gstreamer-rtsp-1.0 --libs`

Any help would be great, thanks!

Author:Shalin Upadhyay,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49907889/gstreamer-compiling-with-rtsp-server
yy