I'm currently trying to setup a Ubuntu server to redistribute a rtsp feed coming from an ip camera.

I saw that the gst-rtsp-server library of gstreamer could help me with this issue.

I installed the following package:

sudo apt-get install libgstrtspserver-1.0-dev sudo apt-get install gstreamer1.0-rtsp sudo apt-get install libglib2.0-dev 

I then cloned the gst-rtsp-server library repo on my desktop:

git clone 

But, when I try to compile a C file (gst-rtsp-server/examples/test-launch.c) given as an example of how to use the library using gcc:

gcc test-launch.c -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include 

I get the following error:

/tmp/ccM7e45N.o: In function `main': test-launch.c:(.text+0x2e): undefined reference to `g_option_context_new' test-launch.c:(.text+0x4a): undefined reference to `g_option_context_add_main_entries' test-launch.c:(.text+0x4f): undefined reference to `gst_init_get_option_group' test-launch.c:(.text+0x61): undefined reference to `g_option_context_add_group' test-launch.c:(.text+0x79): undefined reference to `g_option_context_parse' test-launch.c:(.text+0x99): undefined reference to `g_printerr' test-launch.c:(.text+0xa5): undefined reference to `g_option_context_free' test-launch.c:(.text+0xb1): undefined reference to `g_clear_error' test-launch.c:(.text+0xc7): undefined reference to `g_option_context_free' test-launch.c:(.text+0xd6): undefined reference to `g_main_loop_new' test-launch.c:(.text+0xdf): undefined reference to `gst_rtsp_server_new' test-launch.c:(.text+0x107): undefined reference to `g_object_set' test-launch.c:(.text+0x113): undefined reference to `gst_rtsp_server_get_mount_points' test-launch.c:(.text+0x11c): undefined reference to `gst_rtsp_media_factory_new' test-launch.c:(.text+0x13a): undefined reference to `gst_rtsp_media_factory_set_launch' test-launch.c:(.text+0x14b): undefined reference to `gst_rtsp_media_factory_set_shared' test-launch.c:(.text+0x162): undefined reference to `gst_rtsp_mount_points_add_factory' test-launch.c:(.text+0x16e): undefined reference to `g_object_unref' test-launch.c:(.text+0x17f): undefined reference to `gst_rtsp_server_attach' test-launch.c:(.text+0x19a): undefined reference to `g_print' test-launch.c:(.text+0x1a6): undefined reference to `g_main_loop_run' collect2: error: ld returned 1 exit status 

There's something I'm missing but I don't know what... ><'

The error is obviously coming from a missing header, but which one and where can I get it?

As always, thanks for the help/tips!

1 Answer

If this returns something for you:

pkg-config --modversion gstreamer-rtsp-server-1.0 

(For me, it returns 1.14.1)

You can use the following gcc command to compile the wanted example:

gcc -o test-launch test-launch.c `pkg-config --cflags --libs gstreamer-rtsp-server-1.0` 

P.S. in the command, make sure you use backticks ` and not apostrophes '

Source:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy