gst-full: Link Gstreamer in Static modem with CMake
Describe your issue
When Trying to compiled an application with the statically linked Gstreamer library, the following error is generated:
[ 33%] Linking CXX executable rcvstream_exe
/usr/bin/ld: /opt/g/b/libgstreamer-full-1.0.a(gstplugin.c.o): undefined reference to symbol 'g_module_supported'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/rcvstream_exe.dir/build.make:164: rcvstream_exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/rcvstream_exe.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Failed <<< imp_rcvstream [1.99s, exited with code 2]
Setup
- Operating System: Ubuntu 20.04
- Device: Computer
- GStreamer Version: 1.20 (main branch)
- Command line:
Steps to reproduce the bug
The application is built based on cmake
and colcon
- open terminal
- type
colcon build
Additional Information
I have attached the CMakelists.txt
file for your reference.
CMakelists.txt