error compiling code using gst-rtsp-server

Tim-Philipp Müller t.i.m at zen.co.uk
Wed May 15 14:51:12 PDT 2013


On Wed, 2013-05-15 at 06:58 -0700, mrjojan wrote:

Hi,

> I`m trying to make a simple c program using gstreamer rtsp server.
> For example i use the gst-rtsp-server/example/test-video.c file .
> I use this gcc command to compile test-video.c to an object file. 
> 
> gcc -I/usr/include/libxml2 -I/usr/include/glib-2.0
> -I/usr/include/gstreamer-1.0 -I/usr/lib/arm-linux gnueabi/glib-2.0/include
> -O0 -g3 -Wall -c -o"test-video.o" "test-video.c" `pkg-config --cflags --libs
> gstreamer-1.0`
> 
> Next, use the following gcc command line to name the output executable rtsp
> and link the object file to the necessary libraries`
> 
> gcc  -o"rtsp"  ./test-video.o   -L/opt/gstreamer/lib -lgstrtspserver-1.0
> -lgstreamer-1.0 -lglib-2.0 
> 
> My gstreamer is in /opt.

You should get all compiler flags and linker flags / libs via
pkg-config. Maybe something like this will work:

  gcc `pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-1.0` \
      -O0 -g3 -Wall -c -o test-video test-video.c


> when i run the programm, i have an error like this.
> 
> ./rtsp: error while loading shared libraries: libgstrtspserver-1.0.so.0:
> cannot open shared object file: No such file or directory
> 
> What can i do to resolve this problem?

You might need to set LD_LIBRARY_PATH to /opt/lib/xyz or put it
into /etc/ld.so.conf* and run sudo ldconfig.

Cheers
 -Tim



More information about the gstreamer-devel mailing list