GNOME Bugzilla – Bug 121308
libgnomeuimm 1.3 compilation fails with GCC 3.3
Last modified: 2011-01-16 23:41:46 UTC
Using debian's gcc (a prerelease of 3.3.2), compilation fails with this error: ../../libgnomeui/libgnomeuimm/app-helper.h: In member function `GnomeUIInfo* Gnome::UI::Items::Array<T_Info>::gobj() const [with T_Info = Gnome::UI::Items::SubTree]': app.cc:107: instantiated from here ../../libgnomeui/libgnomeuimm/app-helper.h:265: error: `GnomeUIInfo' is an inaccessible base of `Gnome::UI::Items::Info' I can currently workaround this by using a c-style cast instead of static_cast: --- libgnomeuimm1.3-1.3.17.orig/libgnomeui/libgnomeuimm/app-helper.h +++ libgnomeuimm1.3-1.3.17/libgnomeui/libgnomeuimm/app-helper.h @@ -262,7 +262,8 @@ GnomeUIInfo* gobj() const - { return static_cast<GnomeUIInfo*>(data_); } + //{ return static_cast<GnomeUIInfo*>(data_); } + { return (GnomeUIInfo*)(data_); } };
*** This bug has been marked as a duplicate of 121307 ***
I don't think this is a duplicate of #121308 because it applies to 1.3, not 1.2. The problem is the same, though.
Oh, sorry. I guess it might be better to change class Info : protected GnomeUIInfo to class Info : public GnomeUIInfo, with a comment about the cast there. I don't know whether this is a true compiler error though. Let's do this quick if necessary, because I was about to releas 2.0.0.
I suspect a gcc bug, but I'm a little out of my league there. Changing protected to public works for me, no c-style casting necessary.
*** Bug 121494 has been marked as a duplicate of this bug. ***
Fixed in cvs. Please test the 2.0.0 test tarball at http://www.murrayc.com/temp/