GNOME Bugzilla – Bug 453698
Error compiling libgnomekbd...
Last modified: 2007-12-16 13:07:43 UTC
I am getting the below error when trying to compile libgnomekbd. I have the following version of glib and popt installed. glib: 2.12.12 popt: 1.11 if gcc -DHAVE_CONFIG_H -I. -I. -I.. -Wall -Wmissing-prototypes -I.. -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -march=athlon-mp -pipe -DPIC -fPIC -O3 -MT gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.o -MD -MP -MF ".deps/gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.Tpo" -c -o gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.o `test -f 'gkbd-keyboard-drawing-test.c' || echo './'`gkbd-keyboard-drawing-test.c; \ then mv -f ".deps/gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.Tpo" ".deps/gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.Po"; else rm -f ".deps/gkbd_keyboard_drawing_test-gkbd-keyboard-drawing-test.Tpo"; exit 1; fi In file included from /usr/include/libbonobo-2.0/bonobo/bonobo-i18n.h:37, from /usr/include/libgnome-2.0/libgnome/gnome-i18n.h:41, from /usr/include/libgnome-2.0/libgnome/libgnome.h:30, from /usr/include/libgnomeui-2.0/gnome.h:5, from gkbd-indicator-test.c:34: /usr/include/glib-2.0/glib/gi18n.h:30:1: error: "N_" redefined In file included from /usr/include/libgnome-2.0/libgnome/gnome-program.h:41, from /usr/include/libgnome-2.0/libgnome/libgnome.h:29, from /usr/include/libgnomeui-2.0/gnome.h:5, from gkbd-indicator-test.c:34: /usr/include/popt.h:161:1: error: this is the location of the previous definition make[2]: *** [gkbd_indicator_test-gkbd-indicator-test.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/usr/src/libgnomekbd-2.18.2/test' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/libgnomekbd-2.18.2' make: *** [all] Error 2
I do not really understand why this happens. It seems there is a mess with your gnome headers. Single included file (gnome.h) indirectly includes two other files (gi18n.h and popt.h) with conflicting definitions of the macro N_. Very strange indeed.
Think there might be something failing in the gi18n.h for libgnomekbd. popt.h defines N_ but gi18n.h defines N_(String). No other gnome package gives me this error. Below are the to definitions from the headers on my system. This is from popt.h #if !defined(N_) #define N_(foo) foo #endif This is from gi18n.h #ifdef gettext_noop #define N_(String) gettext_noop (String) #else #define N_(String) (String) #endif
Can it be some kind of verson skew in the headers? The thing is that I cannot reproduce the problem on my systems:( May be, we should (temporary?) assign that bug to libgnome so people maintaining gnome.h (gi8n.h) would be able to give a hint...
Works for me if it can solve the problem. Have this issue on 3 machines that all have the same gnome package versions etc.
What distro is it?
This is with Sourcemage. I am the gnome maintainer for it. With the initial 2.18.x release it compiled just fine.
With the release 2.18 of what? libgnomekbd or gnome? The difference between libgnomekbd 2.18.0 and the latest one is tiny.
When I first created the sourcemage entries for gnome 2.18.0 it compiled without any problems. But when I did the last gnome release update I happen to try recompiling libgnomekbd and got this error.
ok, could you please try earlier version of libgnomekbd (2.18.0) with the latest 2.18.x gnome? I just do not understand what exactly triggered that issue...
Earlier versions of libgnomekbd are failing with the same error.
Very interesting. So libxklavier 2.18.* cannot be build with the latest gnome 2.18.x but it could be built with 2.18.0. To me it indicates there is some problem with the latest gnome libs, don't you think?
More than likely in the ones you mentioned before.
I am also having this problem and OS X users are reporting this problem on MacPorts.org mailing lists. It seems that libgnomekbd is the only library failing on this issue.
The only idea I have is that some magic is broken in configure.in. The question is what is it (and how could I reproduce it on my system...)
For the record, I just did clean checkout of libgnomekbd from gnome svn and built it. No problem :///
This is a change that has occured with the latest version of popt (1.12). I can reproduce this as well (on Gentoo).
Created attachment 100741 [details] [review] libgnomekbd-2.21.1-popt-to-goption.patch Well, there are a few things here. The first is that the test program still uses popt. I am attaching a patch here for that. That should allow the compile to get further (further explanation to follow for that). Another thing is that the test code is unconditionally built. I will create a patch for that shortly as a separate bug. Finally, even with the supplied patch, the compile will fail as libgnome links against popt still. We *could* hack around this (conditionally) ... but Im trying to see if there is a better way to deal with this.
Created attachment 100743 [details] [review] libgnomekbd-2.21.1-no-libbonobo.patch Alright, looking at the problem properly, it seems that I just overlooked something simple. The bug is caused by an old header include laying around. This patch can be pushed to the 2.20 series as well safely if desired. libgnomekbd doesnt use libbonobo, but was relying on it for the _ macro. Just switching it to use the glib i18n header fixes the issue. I will open a new bug for the conversion to goption from popt.
Great! Well spotted! Thanks, I've committed the fix. I will think about applying it to 2.20.