Search code examples
ccompilationgstreamerglibgobject

GStreamer : header-related compiling errors gst-interfaces package


I'm a relatively new programmer, so forgive me if this is a rather stupid question.

I just wrote a medium-scale program, and I'm having some trouble compiling. My includes look like this:

#include <glib.h>
#include <glib-object.h>
#include <X11/Xlib.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <gst/interfaces/xoverlay.h>

Plus some other custom header files (two, for a couple of GObjects I'm using)

And I'm trying to use the following command line:

gcc -Wall (my source files) -o (my output) `pkg-config --cflags --libs gdk gtk+-2.0 glib-2.0 gobject-2.0 gstreamer-0.10  x11`

I get a lot of compiling errors (well over 1000), all of them related to the libraries I'm using. Most of them look like:

/usr/include/glib-2.0/gobject/gtype.h:367: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'

/usr/include/glib-2.0/gobject/gobject.h:199: error: expected ')' before '*' token

/usr/include/glib-2.0/gobject/gsignal.h:262: error: expected declaration specifiers or '...' before 'GSignalFlags'

And so on, and so forth.

Any help would be very much appreciated. I'm sure it's some kind of stupid mistake, either with the linking, or the includes, but I just can't figure it out.


Solution

  • Look at the very first error and ignore the others.

    One possibility is that the first error says one of the #include was not found. If so, just fix that, a whole bunch of the errors are likely to be fallout from that problem.

    Perhaps you are missing one of the needed modules on your pkg-config command line, such as gstreamer-interfaces-0.10 perhaps, just a guess.