gtk_init seg fault



Hi all,

	I'm quite new to GTK, so apologies for the newbie question...
I've looked through the docs and the FAQ, but I can't seem to find a
reason why I'm having this problem.

	Basically, I have some C code that spans several files which I
would like to add a GUI to.  As a starting point, I removed my old main
function completely and replaced it with the Web tutorial's HelloWorld
example.  So, none of my code would be called, but that's ok...I'll merge
the two mains later.  And that's where I'm stuck now.  When I compile my
code with HelloWorld, I get a segmentation fault.  According to gdb, it's
on the gtk_init (&argc, &argv) line.  I compile this same code all by
itself and indeed, I get the HelloWorld example working perfectly...

	I am using a makefile, and like the FAQ says, I'm including
`gtk-config --cflags` when I compile each individual file [even the other
files that don't use gtk].  At the linking phase, I'm including
`gtk-config --libs`.

	I have gtk/gtk.h included in the HelloWorld.c file, but I've also
tried including it in all of my .c files with no effect.
	
	Does anyone know what could be wrong or what I can do to track
down the problem?

	...also, I have another problem which I've ignored, but maybe
it'll help track down the problem.  In my files, I have a sequence of
#include's of standard header files and then a sequence of my personal
header files.  If insert #include <gtk/gtk.h> between these two sets of
header files, I get a parse error...but if I make it the last file I
include in, everything is ok.  The parse error is in the first personal
header file with a ")", even though I don't have any parentheses on that
line...  Is there a rule that says #include <gtk/gtk.h> should be the last
header file to be included in?

	Thanks!  Any help would be appreciated!

Ray








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]