#include in custom plugin and "Error: Failed to load plugin, Expected in: flat namespace"

Tim Müller tim at centricular.com
Mon Nov 18 04:54:23 PST 2013


On Mon, 2013-11-18 at 04:39 -0800, nicksonsix wrote:

Hi,

> I am working on a custom plugin. I added another source and header file,
> typed #include "other_file.h" which is located in the directory next to
> "myplugin.h" and after compiling I received that message when I want to
> check this new plugin:
> 
> "GStreamer-WARNING **: Failed to load plugin
> '/usr/local/lib/gstreamer-1.0/libgstmyplugin.so':
> dlopen(/usr/local/lib/gstreamer-1.0/libgstmyplugin.so, 2): Symbol not found:
> _other_file_function
>   Referenced from: /usr/local/lib/gstreamer-1.0/libgstmyplugin.so
>   Expected in: flat namespace
>  in /usr/local/lib/gstreamer-1.0/libgstmyplugin.so
> 
> What shall I do to make it working? I understand that "myplugin" cannot see
> its but I have no idea how to force it to make "other_file" visible for its.
> (I have tried adding "include_HEADERS = other_file.h in Makefile.am" but
> still nothing.)

This sounds more like a general C compilation/linking issue than
anything GStreamer specific.

Is there other_file.c or .cpp to go with the other_file.h header? Or is
the other_file.h header declaring things for a library?

If the first, then you need to make sure to also add other_file.c (where
the implementation of the _other_file_function lives) to SOURCES. Also
check that _other_file_func() is not marked as 'static'. If it's for a
library, make sure to link against that library, that is add a
-lotherlib to LIBADD.

You can also use 'readelf' and 'nm' on libgstmyplugin.so to investigate
a bit more.

 Cheers
  -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com






More information about the gstreamer-devel mailing list