Gstreamer and C/C++ dev

Hi
I wrote a simple C code with gstreamer libs( gstreamer example code manual ref )
On my ubuntu linux, the gstreamer headers are inside /usr/include/gstreamer-0.10/gst
Inside my C code I wrote:

#include <stdlib.h>
#include <gstreamer-0.10/gst/gst.h>
....
....
I have this error: there are unresolved includes inside <gstreamer-0.10/gst/gst.h>

inside gstreamer-0.10/gst/gst.h I find:
#include <glib.h>
#include <gst/glib-compat.h>
#include <gst/gstenumtypes.h>
#include <gst/gstversion.h>
#include <gst/gstbin.h>
#include <gst/gstbuffer.h>
#include <gst/gstbufferlist.h>
#include <gst/gstcaps.h>
....
....
But On my ubuntu I have

/usr/include/glib-2.0/glib.h

/usr/include/gstreamer-0.10/gst/gst.h
/usr/include/gstreamer-0.10/gst/gstenumtypes.h

How to solve the problem? I thank you...

Sorry for my english...it's no good

Assuming you're using gcc, you can specify extra include directories with -I<path>, e.g:

gcc -I/usr/include/gstreamer-0.10

tells the compiler to look in /usr/include/gstreamer-0.10.

You should probably include -I/usr/include/gstreamer-0.10 and -I/usr/include/glib-2.0, and then #include <gst/gst.h> in your source file. That way, you can use new versions of the headers by just changing the -I flags on your command line.

John G

Ok...thanks....

I used -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/include/libxml2 -I/usr/lib/glib-2.0/include and now the code is ok

I have two small errors:
undefined reference to `gst_init'
undefined reference to `gst_version'

Example gstreamer manual ref code :

const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, &micro, &nano);

If I delete these two lines, the code is successfully constructed
what is the problem?

These are linker errors - you need to link with the pre-compiled gstreamer library. This means you need to find where that library is and, if it's not in a standard directory like /lib/ or /usr/lib/, pass that as an -L option to specify the library directory to gcc, much like you did with -I (uppercase 'i'), and then you need to pass an -l (lowercase 'L') option, e.g. the following:

gcc -L/usr/lib/gstreamer-0.10/ -lgstreamer

Will tell gcc to look for library files in /usr/lib/gstreamer-0.10/, and will look for libgstreamer.so.

I don't know if you'll want to use -lgstreamer, you'll have to find out from their documentation.

Ok thanks....

Build successful