Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading gstreamer plugins in static executable

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:

  • Configured gstreamer (version 1.12.4) with: ./configure --enable-static --disable-shared --enable-static-plugins
  • Built it and gst-plugin-base
  • Added in my code: GST_PLUGIN_STATIC_DECLARE(coreelements); GST_PLUGIN_STATIC_REGISTER(coreelements);
  • Linked my app with libgstcoreelements.a (together with gstreamer-1.0, gstbase-1.0 and gstapp-1.0)

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?

like image 750
Sylvain Avatar asked Sep 03 '25 06:09

Sylvain


1 Answers

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);
}
like image 115
Sylvain Avatar answered Sep 05 '25 01:09

Sylvain