Re: gtk_init seg fault



Hello all,

	About my previous e-mail, some persistence paid off and I found my
bugs.  They were strange ones, which I'm disappointed at my compiler for.
:)  FYI, the reason for my problem was:

On Thu, 8 Feb 2001, Raymond Wan wrote:
> 	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
...
> 	Does anyone know what could be wrong or what I can do to track
> down the problem?

	One of my included files had the global variable "time", which GTK
probably has, too. My mistake for not making it explicitly static, so
shame on me...  But, I thought a compiler would have warned me about
redeclaring a variable. 

...
> 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?

	Likewise, for this problem, one of my header files was defining an
enumerated type called BOOLEAN with values for TRUE and FALSE.  GTK+ has
TRUE and FALSE already defined, which was causing a conflict that could
be solved if I made #include <gtk/gtk.h> occur after my #include line.

	It is true that there was a chance linking in GTK+ code would
introduce possible variable conflicts, but I never thought of this as a
problem since I thought a redeclaration of a variable would generate an
error by my gcc compiler.

	Thank you all for putting up with the newbie's question!  :)  I
appreciate it! 

Ray






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