-
Problem with a GLIB
Hi everybody,
I'm having a problem with my compiler and it goes like this:
I've included the glib.h library like this:
#include </usr/include/glib-2.0/glib.h>
Now, the compiler seems to find glib.h, and seems to identify the type GList which is defined in GLIB. So far so good. BUT, when I try to use a g_list function (e.g. g_list_append), I get an error message that it cannot find the definition of the function.
Now, the way glib.h works is that there are numerous inclusions in it referring to different g*.h files that reside under a directory called "glib" which, like glib.h, resides in directory "glib-2.0".
The point is that the compiler doesn't seem to find any of the included files g*.h under directory "glib".
The error messages that I'm getting are:
/home/knoppix/workspace/glib.h:30:26: error: glib/galloca.h: No such file or directory
/home/knoppix/workspace/glib.h:31:25: error: glib/garray.h: No such file or directory
/home/knoppix/workspace/glib.h:32:30: error: glib/gasyncqueue.h: No such file or directory
...
...
/home/knoppix/workspace/glib.h:49:24: error: glib/glist.h: No such file or directory
/home/knoppix/workspace/glib.h:50:26: error: glib/gmacros.h: No such file or directory
/home/knoppix/workspace/glib.h:51:24: error: glib/gmain.h: No such file or directory
...
and it goes on and on...
Does anyone know why it's doing this and how I can solve it?
Thanks!
-
> #include </usr/include/glib-2.0/glib.h>
This should be
#include <glib.h>
So it can find the rest of the files, you should add this to the command line something like
gcc -I/usr/include/glib-2.0 prog.c
-
Thanks dude, now it seems to have found the rest of the files, BUT now I get an infinite number of errors. The compiler reports a syntax error on every second line of the g*.h files...
I must still be doing something wrong... any idea?
-
Be more specific than "an error", by posting a few examples of actual error messages.
The first error message in particular is most important.
Maybe you forgot to include something else.