After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 453698 - Error compiling libgnomekbd...
Error compiling libgnomekbd...
Status: RESOLVED FIXED
Product: libgnomekbd
Classification: Core
Component: Indicator
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: libgnomekbd maintainers
Sergey V. Udaltsov
Depends on:
Blocks:
 
 
Reported: 2007-07-04 14:18 UTC by Robin Cook
Modified: 2007-12-16 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libgnomekbd-2.21.1-popt-to-goption.patch (6.93 KB, patch)
2007-12-11 07:35 UTC, Saleem Abdulrasool
none Details | Review
libgnomekbd-2.21.1-no-libbonobo.patch (373 bytes, patch)
2007-12-11 07:52 UTC, Saleem Abdulrasool
none Details | Review

Description Robin Cook 2007-07-04 14:18:48 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
Comment 1 Sergey V. Udaltsov 2007-07-04 22:11:24 UTC
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.
Comment 2 Robin Cook 2007-07-04 23:31:46 UTC
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
Comment 3 Sergey V. Udaltsov 2007-07-05 22:44:23 UTC
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...
Comment 4 Robin Cook 2007-07-06 00:16:24 UTC
Works for me if it can solve the problem.  Have this issue on 3 machines that all have the same gnome package versions etc.
Comment 5 Sergey V. Udaltsov 2007-07-06 17:21:38 UTC
What distro is it?
Comment 6 Robin Cook 2007-07-06 23:18:56 UTC
This is with Sourcemage.   I am the gnome maintainer for it.  With the initial 2.18.x release it compiled just fine.
Comment 7 Sergey V. Udaltsov 2007-07-11 10:18:11 UTC
With the release 2.18 of what? libgnomekbd or gnome? The difference between libgnomekbd 2.18.0 and the latest one is tiny.
Comment 8 Robin Cook 2007-07-11 20:53:17 UTC
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.

Comment 9 Sergey V. Udaltsov 2007-07-14 12:05:12 UTC
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...
Comment 10 Robin Cook 2007-07-14 20:44:46 UTC
Earlier versions of libgnomekbd are failing with the same error.
Comment 11 Sergey V. Udaltsov 2007-07-14 20:59:43 UTC
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?
Comment 12 Robin Cook 2007-07-15 01:25:36 UTC
More than likely in the ones you mentioned before.
Comment 13 Randall Wood 2007-07-20 09:25:10 UTC
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.
Comment 14 Sergey V. Udaltsov 2007-07-20 18:21:43 UTC
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...)
Comment 15 Sergey V. Udaltsov 2007-07-21 11:17:01 UTC
For the record, I just did clean checkout of libgnomekbd from gnome svn and built it. No problem :///
Comment 16 Saleem Abdulrasool 2007-12-11 06:30:37 UTC
This is a change that has occured with the latest version of popt (1.12).  I can reproduce this as well (on Gentoo).
Comment 17 Saleem Abdulrasool 2007-12-11 07:35:35 UTC
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.
Comment 18 Saleem Abdulrasool 2007-12-11 07:52:42 UTC
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.
Comment 19 Sergey V. Udaltsov 2007-12-16 13:07:43 UTC
Great! Well spotted! Thanks, I've committed the fix. I will think about applying it to 2.20.