Skip to content

player: Add static keyword to _config_quark_table

There is a multiple definition of '_config_quark_table' linker error when running the player gst example on Android using NDK v22. The linker error doesn't seem to happen on a previous version.

/home/mortimer/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: error: /home/mortimer/Projects/basura/build/dist/android_universal/arm64/lib/libgstplay-1.0.a(gstplay.c.o): multiple definition of '_config_quark_table'
/home/mortimer/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: /home/mortimer/Projects/basura/build/dist/android_universal/arm64/lib/libgstplayer-1.0.a(gstplayer.c.o): previous definition here

_config_quark_table seems to only be used in the local compilation file, so adding static fixes the error. I wonder why is not triggering an error on other platforms.

There are multiple definitions of the same symbol indeed:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/gst-libs/gst/play/gstplay.c https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/gst-libs/gst/player/gstplayer.c

Edited by Sebastian Dröge

Merge request reports