<div dir="ltr">GStreamer version 1.20.3  <br>GStreamer build with `meson --prefix=/usr/local -Dgpl=enabled -Dpython=enabled -Dgst-plugins-ugly:x264=enabled -Drs=enabled -Drtsp_server=enabled -Drtsp_server:examples=enabled builddir`<br><br>I am trying to make the [RTSP server example](<a href="https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-rtsp-server/docs/README">https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-rtsp-server/docs/README</a>):<br><br>```<br>#include <gst/gst.h><br>#include <gst/rtsp-server/rtsp-server.h><br>int main (int argc, char *argv[])<br>{<br>  GstRTSPServer *server;<br>  GMainLoop *loop;<br>  gst_init (&argc, &argv);<br>  server = gst_rtsp_server_new ();<br>  /* make a mainloop for the default context */<br>  loop = g_main_loop_new (NULL, FALSE);<br>  /* attach the server to the default maincontext */<br>  gst_rtsp_server_attach (server, NULL);<br>  /* start serving */<br>  g_main_loop_run (loop);<br>}<br>```<br>I use the CMake, the CMakeLists.txt is:<br>```<br>cmake_minimum_required(VERSION 3.5)<br>set(PROJECT "TEST Server")<br>set(EXECUTABLE_NAME "test-server")<br>project(${PROJECT})<br>include(GNUInstallDirs)<br>set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})<br>set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)<br>find_package(PkgConfig) <br><br>pkg_check_modules(GST REQUIRED<br>  gstreamer-1.0<br>  gstreamer-base-1.0<br>  gstreamer-audio-1.0<br>  gstreamer-video-1.0<br>  gstreamer-app-1.0<br>  gstreamer-rtp-1.0<br>  gstreamer-rtsp-1.0<br>  gstreamer-rtsp-server-1.0<br>)<br><br>INCLUDE_DIRECTORIES(<br>  "include"<br>  ${GST_INCLUDE_DIRS}<br>)<br>set(RTSP_SERVER_SOURCES<br>  "src/main.c"<br>)<br>add_executable(${EXECUTABLE_NAME} ${RTSP_SERVER_SOURCES})<br>target_link_libraries(${EXECUTABLE_NAME}<br>  ${GST_LIBRARIES}<br>)<br>```<br><br>## Error<br>This is the error that is returned when I make this small example:<br>```<br>[ 50%] Building C object CMakeFiles/test-server.dir/src/main.c.o<br>[100%] Linking C executable ../bin/test-server<br>/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/<a href="http://libgstrtspserver-1.0.so">libgstrtspserver-1.0.so</a>: undefined reference to `gst_rtsp_connection_set_content_length_limit'<br>/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/<a href="http://libgstrtspserver-1.0.so">libgstrtspserver-1.0.so</a>: undefined reference to `gst_element_request_pad_simple'<br>/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/<a href="http://libgstrtspserver-1.0.so">libgstrtspserver-1.0.so</a>: undefined reference to `gst_buffer_new_memdup'<br>collect2: error: ld returned 1 exit status<br>make[2]: *** [CMakeFiles/test-server.dir/build.make:84: ../bin/test-server] Error 1<br>make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/test-server.dir/all] Error 2<br>make: *** [Makefile:84: all] Error 2<br>```<br><br>My question: how can I solve this linking error? <br></div>