GNOME Bugzilla – Bug 610321
Compile errors with gtk-2.10.4: GTK_BUTTONBOX_CENTER undeclared
Last modified: 2018-06-29 22:35:09 UTC
dialog-options.c:952: error: ‘GTK_BUTTONBOX_CENTER’ undeclared (first use in this function) That probably only exists in an unstable version of gtk2 (gtk.h). I am using CentOS 5.4 and gtk2-devel-2.10.4-20.el5.i386 which does not have that. If I replace it with GTK_BUTTONBOX_DEFAULT_STYLE or something, I can continue, but the next show stopper is just around the corner: window-autoclear.c: In function ‘gnc_autoclear_window_ok_cb’: window-autoclear.c:162: error: ‘GHashTableIter’ undeclared (first use in this function) window-autoclear.c:162: error: (Each undeclared identifier is reported only once window-autoclear.c:162: error: for each function it appears in.) window-autoclear.c:162: error: expected ‘;’ before ‘iter’ window-autoclear.c:163: warning: ISO C90 forbids mixed declarations and code window-autoclear.c:169: warning: implicit declaration of function ‘g_hash_table_iter_init’ window-autoclear.c:169: error: ‘iter’ undeclared (first use in this function) window-autoclear.c:170: warning: implicit declaration of function ‘g_hash_table_iter_next’ How am I supposed to compile this? ./configure passes just fine.
The functions were newly introduced in the enhancement of bug#608436; obviously we didn't check for gtk-2.10 compatibility closely enough. This needs to be fixed, though.
Can you please run "make -i" once, then "make -i" again and attach the output of the second run here so that we can see all compiler errors? Also, what is your version of "glib" or "glib2"? The functions in question would be available in gtk2-2.12 and glib-2.16, but you obviously have older versions.
Created attachment 154146 [details] [review] Replace GHashTableIter with g_hash_table_foreach Hello, I replaced GHashTableIter with g_hash_table_foreach. (Bleah!) OTOH, I didn't touch dialog-options.c, where the GTK_BUTTONBOX_CENTER appears.
Review of attachment 154146 [details] [review]: I have replaced GTK_BUTTONBOX_CENTER with GTK_BUTTONBOX_START in r18694. That fixes the first problem. I tried to apply the attached patch, but it doesn't apply cleanly. Could you please update the patch so it applies to the current trunk ?
Created attachment 154273 [details] Compilation errors
Thanks Geert, the GTK_BUTTONBOX issue is no longer an issue. However, some new errors popped up this time. See the attachment at around lines 55-60. I have glib2-2.12.3 and gtk2-2.10. Personally I don't think it is a good idea to depend on such new versions of libraries which are not included even in the most recent Linux distributions.
I had just discovered these compilation errors as well. They are fixed in 18700. glib2-2.12.x and gtk2-2.10 are not new versions. They are rather conservative choices. The current stable glib2 is 2.22. The current gtk+ is 2.18. For example, Mandriva 2010.0, Fedora 12 and current Debian ship glib2 2.22.x. Even Debian Lenny, the oldest still supported Debian release comes with 2.16. Same for gtk+: Mandriva 2010.0, Fedora 12 and current Debial ship gtk+ 2.18.x. Debian Lenny ships 2.12.x So I think all currently maintained distributions are covered with these requirements.
By the way, I still haven't applied the GHashTableIter patch because it doesn't apply cleanly to trunk.
Comment on attachment 154146 [details] [review] Replace GHashTableIter with g_hash_table_foreach Indeed - this patch doesn't apply to trunk, because r18612 and r18632 subsequently edited this file for compatibility with older glib versions. Please rebase your patch on the current trunk and send it again. Thanks!
I have reworked the patch to apply to trunk. Committed in r18792.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=610321. Please update any external references or bookmarks.