I need to build a static Linux executable with gstreamer and use the queue factory which is part of the coreelements plugin. What I did was:
./configure --enable-static --disable-shared --enable-static-plugins
GST_PLUGIN_STATIC_DECLARE(coreelements);
GST_PLUGIN_STATIC_REGISTER(coreelements);
Linking fails with:
undefined reference to gst_plugin_coreelements_register()
I can verify that gst_plugin_coreelements_register
is in the static library file:
$ nm libgstcoreelements.a |grep gst_plugin_coreelements_register
00000000000002c0 T gst_plugin_coreelements_register
Do you see what I am doing wrong?
What I was missing is an extern "C" { }
block around the first gstreamer macro as it declares an extern C-style function, and my application is compiled with g++:
extern "C" {
GST_PLUGIN_STATIC_DECLARE(coreelements);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With