The order of linking libs and plugins of gstreamer in CMakeLists Android

Ramil Galin via gstreamer-devel <[email protected]> Wed, 21 Feb 2024 17:10:20 +0100
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <CAL1bUCam492DFHD86YmUODEz+8mpdT+_1hHJME7iWv0BvKypZQ@mail.gmail.com>
Hello!

I am using gstreamer for Android and using cmake to build a project. But
when I try to build gstreamer_android.so I have linkage issues kind of
these:
```
...
ld: error: undefined symbol: gst_codec_utils_aac_get_sample_rate_from_index
>>> referenced by gsttypefindfunctions.c:1259
...
ld: error: undefined symbol: gst_video_dither_method_get_type
>>> referenced by gstvideoconvertscale.c:329
...
```

In my cmakelists the order is the following:
```
set(
GST_PLUGINS
gstcoreelements
gsttypefindfunctions
gstvideorate
gstvideofilter
gstvideofiltersbad
gstvideoconvertscale
gstautodetect
gstvideotestsrc
gstplayback
gstx264
gstvideoparsersbad
gstandroidmedia
gstopengl
gstapp
gstisomp4
gstalaw
gstvpx
)

set(
GST_PlUGIN_LIBS
orc-0.4
gstgl-1.0
graphene-1.0
png16
jpeg
x264
gstapp-1.0
gstvideo-1.0
gstaudio-1.0
gstpbutils-1.0
gsttag-1.0
gstphotography-1.0
gstcontroller-1.0
gstcodecparsers-1.0
gstplay-1.0
gio-2.0
glib-2.0
gobject-2.0
)

set(
GST_LIBS
gstbase-1.0
gstreamer-1.0
gmodule-2.0
gobject-2.0
glib-2.0
ffi
pcre2-8
iconv
intl
z
)

target_link_libraries(
${PROJECT_NAME} PUBLIC
${loglib}
${GLESv2-lib}
EGL
${GST_PLUGINS}
${GST_PLUGIN_LIBS}
${GST_LIBS}
)
```
What should be the correct order of linkage? Do I need to link smth else?
Any help is appreciated.