GNOME Bugzilla – Bug 122053
fails to compile w/GCC 3.3.2
Last modified: 2004-12-22 21:47:04 UTC
Using the debian prerelease of gcc 3.3.2 (g++-3.3 1:3.3.2-0pre3) the notebook example fails with: In file included from /usr/include/gtkmm-2.0/gtkmm.h:85, from examplewindow.h:22, from examplewindow.cc:20: /usr/include/gtkmm-2.0/gtkmm/notebook.h: In member function `const Gtk::Notebook_Helpers::Page& Gtk::Notebook_Helpers::PageIterator::operator*() const': /usr/include/gtkmm-2.0/gtkmm/notebook.h:822: error: ` Gtk::Notebook_Helpers::PageIterator' is an inaccessible base of ` Gtk::Notebook_Helpers::Page' /usr/include/gtkmm-2.0/gtkmm/notebook.h: In member function `const Gtk::Notebook_Helpers::Page* Gtk::Notebook_Helpers::PageIterator::operator->() const': /usr/include/gtkmm-2.0/gtkmm/notebook.h:828: error: ` Gtk::Notebook_Helpers::PageIterator' is an inaccessible base of ` Gtk::Notebook_Helpers::Page' In file included from /usr/include/gtkmm-2.0/gtkmm.h:85, from examplewindow.h:22, from main.cc:20: /usr/include/gtkmm-2.0/gtkmm/notebook.h: In member function `const Gtk::Notebook_Helpers::Page& Gtk::Notebook_Helpers::PageIterator::operator*() const': /usr/include/gtkmm-2.0/gtkmm/notebook.h:822: error: ` Gtk::Notebook_Helpers::PageIterator' is an inaccessible base of ` Gtk::Notebook_Helpers::Page' /usr/include/gtkmm-2.0/gtkmm/notebook.h: In member function `const Gtk::Notebook_Helpers::Page* Gtk::Notebook_Helpers::PageIterator::operator->() const': /usr/include/gtkmm-2.0/gtkmm/notebook.h:828: error: ` Gtk::Notebook_Helpers::PageIterator' is an inaccessible base of ` Gtk::Notebook_Helpers::Page' Oddly enough, this error did _not_ occur with debian's previous version of g++-3.3 (1:3.3.2-0pre2), which gave the very similar problem reported in bug #121308
It may also be necessary to reopen of bug #117494 - it gives a different error now, though... treeiter.cc: In member function `const Gtk::TreeNodeChildren& Gtk::TreeRow::children() const': treeiter.cc:145: error: `Gtk::TreeIter' is an inaccessible base of ` Gtk::TreeNodeChildren'
I guess you can work around this with a C-style cast (with a TODO comment next to it.). Could you try this, please? We should probably change the inheritance from private to public, but we can not do that without changing the API.
By the way, you are reporting 2 compiler errors here, which doesn't seem possible to me unless you are already using some workaround for the treeview error. Please try to keep the bug reports focused.
sorry about that. Using c-style cast or reinterpret_cast fixes it. Actually, there are 3 or 4 such places where this is necessary. I'll send a patch soon.
is there a difference between a c-style cast and reinterpret_cast? using c-style seemed like the natural thing to do when working with a c type (i.e. Bug 121307), but here I used reinterpret_cast. Maybe it's just my aesthetics, I dunno.
Created attachment 19917 [details] [review] workaround for inaccessible base bugs
Yes, I think the reinterpret_cast<> is OK. Someone please commit this.
Patched and commited.
Thanks, but this needs to be committed to gtkmm 2.4 as well.
Committed to gtkmm 2.4.