[gst-devel] writing sample plugin

Benoit Fouet benoit.fouet at purplelabs.com
Wed Oct 24 14:51:26 CEST 2007


Hi,

Vinod Nanjaiah wrote:
> Hi!
>
> I could not use "make_element" to create a sample plugin as I was unable to
> access webcvs for downloading gst-template (the connection attempt times
> out).
> So, I followed the plugin writer's guide and wrote a sample plugin.
>
> Now, when I try to compile this sample plugin, it gives an error.
> Can somebody please guide me how to go about solving this.
>
> I'm am trying to compile it with -
> $> gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) my_filter.c -o
> my_filter
>
> This is the error that I get -
> my_filter.c:404: error: âPACKAGEâ undeclared here (not in a function)
>
> Line 404 contains the following declaration -
> GST_PLUGIN_DEFINE(
> 	GST_VERSION_MAJOR,
> 	GST_VERSION_MINOR,
> 	"my_filter", 
> 	"My filter plugin", 
> 	plugin_init,
> 	"1.0", 
> 	"LGPL",
> 	"GStreamer", 
> 	"http://gstreamer.net"
> );
>
>
> Using VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN in the above
> structure gives "undeclared here (not in a function)" error.
> But I replaced them with some strings.
> However, the one that I am not able to understand is the 
> "PACKAGE undeclared here (not in a function)" error.
>
>   

if you don't include the config.h file, you have to define PACKAGE on
your own:

#ifndef PACKAGE
# define PACKAGE "foo"
#endif
GST_PLUGIN_DEFINE(...);

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the gstreamer-devel mailing list