GNOME Bugzilla – Bug 87877
gnomemm-1.2.2 fails to compile (src/gnome--/procbar.cc)
Last modified: 2004-12-22 21:47:04 UTC
Both we (the lunar linux maintainers) and the people from Gentoo have exactly the same problem. I can state for a fact that it *already* compiled before correctly, date 20020423 (i.e. 6 weeks ago), but since that date absolutely nothing I can find has changed. gcc was and is still 2.95.3. Freshly compiled and installed machines also suffer these ill effects. Any help would be incredibly appreciated... Auke Kok c++ -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gnome--\" -I. -I./.. -I.. -I../../src -I../../src -I../../src/gtk-- -I../../gdk-- -I/usr/lib/gtkmm/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/lib/sigc++-1.0/include -I/usr/include/sigc++-1.0 -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -O3 -mcpu=i686 -march=i686 -funroll-loops -Wall -Wno-unused -c procbar.cc -fPIC -DPIC -o procbar.lo procbar.cc: In method `Gnome::ProcBar::ProcBar(const Gtk::Label &, const vector<Gdk_Color *,allocator<Gdk_Color *> > &, gint (*)())': procbar.cc:23: passing `gint (*)()' as argument 5 of `gnome_proc_bar_construct(GnomeProcBar *, GtkWidget *, int, GdkColor *, gint (*)(void *))' make[1]: *** [procbar.lo] Error 1 make[1]: Leaving directory `/usr/src/gnomemm-1.2.2/src/gnome--' make: *** [all-recursive] Error 1
The function pointer type is wrong. The callback should actually take a gpointer. We can't change that in the stable API, but you can add a cast to the correct type in the .gen_h file. You might find it simplest if you use a typedef. It will probably still work, and if it doesn't then it's not important because I doubt anybody is using that constructor anyway. Please tell if you have any problems writing the patch.
Hmm, actually I can reproduce it here, so I'll do it.
OK, please try from cvs (gnome-- module) and tell me if it's ready for a new release.
applied the patch over the 4 affected files and got: /usr/src/gnomemm-1.2.2/src/gnome-- # c++ -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gnome--\" -I. -I./.. -I.. -I../../src -I../../src -I../../src/gtk-- -I../../gdk-- -I/usr/lib/gtkmm/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/lib/sigc++-1.0/include -I/usr/include/sigc++-1.0 -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -g -O2 -Wall -Wno-unused -c procbar.cc -fPIC -DPIC -o procbar.lo procbar.cc: In method `Gnome::ProcBar::ProcBar(const Gtk::Label &, const vector<Gdk_Color *,allocator<Gdk_Color *> > &, gint (*)())': procbar.cc:23: passing `gint (*)()' as argument 5 of `gnome_proc_bar_construct(GnomeProcBar *, GtkWidget *, int, GdkColor *, gint (*)(void *))' I think you missed one there
What patch? What 4 files? Just get it from cvs. Or maybe you did get it from cvs, but you are using anon cvs, which might not yet have the changes. If you do have a problem with your compiler, please _try_ to fix it yourself and send us a patch. It probably isn't difficult.
Got it from anon cvs, diff -r'd it to see the differences which affected 4 files, but prolly your changes hadn't reflected into it, so I will try again today if I have time. some notes about me to make you understand where/what I am: /* I am not a gnomemm hacker, but a source distro maintainer */ /* I eat #!/bin/bash and #!/usr/bin/perl, but not #define C++ */ I can grab cvs, diff, patch but a (void *) gives me slight headaches ;-)
Got the fix from webCVS, it works, I'm happy, close this bug please! :-)