GNOME Bugzilla – Bug 118868
gcc 2.95.3 fail to compile TreeView.append_column_editable("foo", TreeModelColumn<bool>)
Last modified: 2004-12-22 21:47:04 UTC
gcc 2.95.3 fail to compile examples/book/treeview/editable_cells/examplewindow.cc on the following line: > m_TreeView.append_column_editable("foo", m_Columns.m_col_foo); I don't know what's the problem. It happens on examples/book/treeview/drag_and_drop/examplewindow.cc too. The compiler error message: ../../../../gtk/gtkmm/treeviewcolumn.h: In method `void Gtk::TreeViewColumn::pack_start<bool>(const Gtk::TreeModelColumn<bool> &, bool = true)': ../../../../gtk/gtkmm/treeviewcolumn.h:606: instantiated from `Gtk::TreeViewColumn::TreeViewColumn<bool>(const Glib::ustring &, const Gtk::TreeModelColumn<bool> &)' ../../../../gtk/gtkmm/treeview.h:957: instantiated from here ../../../../gtk/gtkmm/treeviewcolumn.h:100: too few arguments to function `class Gtk::CellRenderer * Gtk::TreeViewColumn_CellRendererGeneration::generate_cellrenderer<bool>(bool)' ../../../../gtk/gtkmm/treeviewcolumn.h:580: at this point in file gmake: *** [examplewindow.o] Error 1
Is this version of gcc 2.95.3 built from source or packaged somehow?
It's the NetBSD system compiler distributed with the 1.6 stable release.
Looks like gcc-2.95.x does not like the declarations of the generate_cellrenderer specializations that I added a few weeks ago to fix bug #113688 (http://bugzilla.gnome.org/show_bug.cgi?id=113688) with gcc-3.2 on debian and win32.
I can not make any sense of the compiler error. If it really doesn't work then someone needs to add an #ifdef, maybe using a configure check.
And we might choose to put the #ifdef in the examples instead of gtkmm itself.
Created attachment 18892 [details] [review] Patch for the gcc 2.95.x build problem
Your patch says +#if !defined(__GNUC__) || __GNUC__ > 2 but isn't gcc 3 also > 2?
Yes, this means the code is included if we don't compile with gcc or the gcc version we use is greater 2 (e.g. it's at least gcc 3.0.0). Or with other words: the code is excluded if we compile with gcc 2.95.x.
Oh, right, now I understand. Let's consider it. But it should have a comment. Patches should patch the ChangeLog. Thanks.
Could you please confirm that you can see the radio buttons for bool TreeView columns when using this patch? For instance, in the demo.
Yes!
Created attachment 18921 [details] [review] Patch for the gcc 2.95.x build problem with ChangeLog entry.
Perfect. Someone please apply to both branches.
Applied. Well done and thanks.