GStreamer : header-related compiling errors gst-interfaces package

2.1k views Asked by At

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.

3

There are 3 answers

1
Havoc P On BEST ANSWER

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.

0
M'vy On

Difficult to say without the code. But I'd bet on a missing semi-colon, or error in a macro maybe. That always generates those kinds of weird messages, even in code that's not your own.

Double check your own code, maybe try to add more debug flag such as -W* family (see GCC)

0
newfront On

Not sure if this helps, but I had the same errors. (I'm developing with XCode 3.2.5 for mac).

I wanted to build an application that linked against my macports libraries /opt/local/lib, and /opt/local/include

I did the following.

  1. Under Targets, double-click the Target App

  2. Under 'Search Paths', a. Always Search User Paths [off] b. Header Search Paths [ add the path(s) to your header location(s) ] ex. /usr/local/include/x c. Library Search Paths [ add the path(s) to your shared Libraries ]

  3. compile and run, should fix the errors

If you are not sure where the libraries are, use pkg-config to find them.

pkg-config usage:

pkg-config --cflags

ex: pkg-config --cflags glib-2.0

-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include

Then you can look at these directories, see if the missing dependency is included, then add the path to either the 'headers' or 'library' paths under Search Paths.

Hope this helps.