installing glib: error: redefinition of typedef 'GListStore'

installing glib: error: redefinition of typedef 'GListStore'

我是 Linux 分发版 CentOS 6.6

的用户,没有 root 权限

我正在尝试从源代码安装 glib-v2.44。

我运行

./configure --prefix=/c3se/users/froslev/Glenn/lib

一切顺利。之后我 运行 make 失败了(下面的输出)

可能是什么问题?

[froslev@glenn glib-2.44.0]$ make
make  all-recursive
make[1]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0'
Making all in .
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0'
Making all in m4macros
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/m4macros'
make  all-am
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/m4macros'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/m4macros'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/m4macros'
Making all in glib
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
  GEN      glibconfig-stamp
config.status: executing glib/glibconfig.h commands
config.status: glib/glibconfig.h is unchanged
make  all-recursive
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
Making all in libcharset
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/libcharset'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/libcharset'
  CC       libcharset_la-localcharset.lo
  CCLD     libcharset.la
  GEN      ref-add.sed
  GEN      ref-del.sed
  GEN      charset.alias
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/libcharset'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/libcharset'
Making all in pcre
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/pcre'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/pcre'
  CC       libpcre_la-pcre_byte_order.lo
  CC       libpcre_la-pcre_chartables.lo
  CC       libpcre_la-pcre_compile.lo
  CC       libpcre_la-pcre_config.lo
  CC       libpcre_la-pcre_dfa_exec.lo
  CC       libpcre_la-pcre_exec.lo
  CC       libpcre_la-pcre_fullinfo.lo
  CC       libpcre_la-pcre_get.lo
  CC       libpcre_la-pcre_globals.lo
  CC       libpcre_la-pcre_jit_compile.lo
  CC       libpcre_la-pcre_newline.lo
  CC       libpcre_la-pcre_ord2utf8.lo
  CC       libpcre_la-pcre_string_utils.lo
  CC       libpcre_la-pcre_study.lo
  CC       libpcre_la-pcre_tables.lo
  CC       libpcre_la-pcre_valid_utf8.lo
  CC       libpcre_la-pcre_xclass.lo
  CCLD     libpcre.la
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/pcre'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/pcre'
Making all in update-pcre
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/update-pcre'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/update-pcre'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/update-pcre'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/update-pcre'
Making all in .
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
  CC       libglib_2_0_la-gallocator.lo
  CC       libglib_2_0_la-gcache.lo
  CC       libglib_2_0_la-gcompletion.lo
  CC       libglib_2_0_la-grel.lo
  CC       libglib_2_0_la-gthread-deprecated.lo
  CC       libglib_2_0_la-garray.lo
  CC       libglib_2_0_la-gasyncqueue.lo
  CC       libglib_2_0_la-gatomic.lo
  CC       libglib_2_0_la-gbacktrace.lo
  CC       libglib_2_0_la-gbase64.lo
  CC       libglib_2_0_la-gbitlock.lo
  CC       libglib_2_0_la-gbookmarkfile.lo
  CC       libglib_2_0_la-gbytes.lo
  CC       libglib_2_0_la-gcharset.lo
  CC       libglib_2_0_la-gchecksum.lo
  CC       libglib_2_0_la-gconvert.lo
  CC       libglib_2_0_la-gdataset.lo
  CC       libglib_2_0_la-gdate.lo
  CC       libglib_2_0_la-gdatetime.lo
  CC       libglib_2_0_la-gdir.lo
  CC       libglib_2_0_la-genviron.lo
  CC       libglib_2_0_la-gerror.lo
  CC       libglib_2_0_la-gfileutils.lo
gfileutils.c:613: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
gfileutils.c:631: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
  CC       libglib_2_0_la-ggettext.lo
  CC       libglib_2_0_la-ghash.lo
  CC       libglib_2_0_la-ghmac.lo
  CC       libglib_2_0_la-ghook.lo
  CC       libglib_2_0_la-ghostutils.lo
  CC       libglib_2_0_la-giochannel.lo
  CC       libglib_2_0_la-gkeyfile.lo
  CC       libglib_2_0_la-glib-init.lo
  CC       libglib_2_0_la-glib-private.lo
  CC       libglib_2_0_la-glist.lo
  CC       libglib_2_0_la-gmain.lo
  CC       libglib_2_0_la-gmappedfile.lo
  CC       libglib_2_0_la-gmarkup.lo
gmarkup.c:2384: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
gmarkup.c:2513: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
  CC       libglib_2_0_la-gmem.lo
  CC       libglib_2_0_la-gmessages.lo
  CC       libglib_2_0_la-gnode.lo
  CC       libglib_2_0_la-goption.lo
  CC       libglib_2_0_la-gpattern.lo
  CC       libglib_2_0_la-gpoll.lo
  CC       libglib_2_0_la-gprimes.lo
  CC       libglib_2_0_la-gqsort.lo
  CC       libglib_2_0_la-gquark.lo
  CC       libglib_2_0_la-gqueue.lo
  CC       libglib_2_0_la-grand.lo
  CC       libglib_2_0_la-gregex.lo
  CC       libglib_2_0_la-gscanner.lo
  CC       libglib_2_0_la-gsequence.lo
  CC       libglib_2_0_la-gshell.lo
  CC       libglib_2_0_la-gslice.lo
  CC       libglib_2_0_la-gslist.lo
  CC       libglib_2_0_la-gstdio.lo
  CC       libglib_2_0_la-gstrfuncs.lo
gstrfuncs.c:874: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
gstrfuncs.c:986: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
  CC       libglib_2_0_la-gstring.lo
  CC       libglib_2_0_la-gstringchunk.lo
  CC       libglib_2_0_la-gtestutils.lo
gtestutils.c: In function 'test_trap_clear':
gtestutils.c:2493: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2493: note: initialized from here
gtestutils.c:2494: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2494: note: initialized from here
gtestutils.c:2495: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2495: note: initialized from here
gtestutils.c: In function 'wait_for_child':
gtestutils.c:2682: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2682: note: initialized from here
gtestutils.c:2683: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2683: note: initialized from here
gtestutils.c: In function 'g_test_run_suite_internal':
gtestutils.c:2117: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2117: note: initialized from here
gtestutils.c:2144: warning: dereferencing pointer '_pp' does break strict-aliasing rules
gtestutils.c:2144: note: initialized from here
  CC       libglib_2_0_la-gthread.lo
  CC       libglib_2_0_la-gthreadpool.lo
  CC       libglib_2_0_la-gtimer.lo
  CC       libglib_2_0_la-gtimezone.lo
  CC       libglib_2_0_la-gtranslit.lo
  CC       libglib_2_0_la-gtrashstack.lo
  CC       libglib_2_0_la-gtree.lo
  CC       libglib_2_0_la-guniprop.lo
  CC       libglib_2_0_la-gutf8.lo
  CC       libglib_2_0_la-gunibreak.lo
  CC       libglib_2_0_la-gunicollate.lo
  CC       libglib_2_0_la-gunidecomp.lo
  CC       libglib_2_0_la-gurifuncs.lo
  CC       libglib_2_0_la-gutils.lo
gutils.c:2085: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
gutils.c:2221: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
  CC       libglib_2_0_la-gvariant.lo
  CC       libglib_2_0_la-gvariant-core.lo
  CC       libglib_2_0_la-gvariant-parser.lo
  CC       libglib_2_0_la-gvariant-serialiser.lo
  CC       libglib_2_0_la-gvarianttypeinfo.lo
  CC       libglib_2_0_la-gvarianttype.lo
  CC       libglib_2_0_la-gversion.lo
  CC       libglib_2_0_la-gwakeup.lo
  CC       libglib_2_0_la-gprintf.lo
  CC       libglib_2_0_la-glib-unix.lo
  CC       libglib_2_0_la-gthread-posix.lo
  CC       giounix.lo
  CC       gspawn.lo
  CCLD     libglib-2.0.la
  CC       gtester.o
  CCLD     gtester
  GEN      glib-public-headers.txt
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
Making all in tests
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/tests'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/tests'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/tests'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib/tests'
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/glib'
Making all in gmodule
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gmodule'
make  all-am
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gmodule'
  CC       libgmodule_2_0_la-gmodule.lo
  CCLD     libgmodule-2.0.la
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gmodule'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gmodule'
Making all in gthread
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gthread'
make  all-am
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gthread'
  CC       libgthread_2_0_la-gthread-impl.lo
  CCLD     libgthread-2.0.la
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gthread'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gthread'
Making all in gobject
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
make  all-recursive
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
Making all in .
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
  CC       libgobject_2_0_la-gatomicarray.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gbinding.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gboxed.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gclosure.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-genums.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gmarshal.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gobject.lo
gobject.c: In function 'object_floating_flag_handler':
gobject.c:2782: warning: dereferencing type-punned pointer will break strict-aliasing rules
gobject.c:2782: warning: dereferencing type-punned pointer will break strict-aliasing rules
gobject.c:2788: warning: dereferencing type-punned pointer will break strict-aliasing rules
gobject.c:2788: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gparam.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gparamspecs.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gsignal.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gsourceclosure.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gtype.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gtypemodule.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gtypeplugin.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gvalue.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gvaluearray.lo
gvaluearray.c: In function 'g_value_array_prepend':
gvaluearray.c:230: warning: 'g_value_array_insert' is deprecated (declared at gvaluearray.h:84)
gvaluearray.c: In function 'g_value_array_append':
gvaluearray.c:253: warning: 'g_value_array_insert' is deprecated (declared at gvaluearray.h:84)
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gvaluetransform.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CC       libgobject_2_0_la-gvaluetypes.lo
gcc: /c3se/users/froslev/Glenn/lib/include: linker input file unused because linking not done
  CCLD     libgobject-2.0.la
  CC       gobject-query.o
  CCLD     gobject-query
  CC       glib-genmarshal.o
  CCLD     glib-genmarshal
  GEN      gobject-public-headers.txt
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
Making all in tests
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject/tests'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject/tests'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject/tests'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject/tests'
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gobject'
Making all in gio
make[2]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio'
  GEN      gconstructor_as_data.h
  GEN      gdbus-daemon-generated.c
make  all-recursive
make[3]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio'
Making all in gdbus-2.0/codegen
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/gdbus-2.0/codegen'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/gdbus-2.0/codegen'
  GEN      gdbus-codegen
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/gdbus-2.0/codegen'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/gdbus-2.0/codegen'
Making all in xdgmime
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/xdgmime'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/xdgmime'
  CC       libxdgmime_la-xdgmime.lo
  CC       libxdgmime_la-xdgmimealias.lo
  CC       libxdgmime_la-xdgmimecache.lo
  CC       libxdgmime_la-xdgmimeglob.lo
  CC       libxdgmime_la-xdgmimeicon.lo
  CC       libxdgmime_la-xdgmimeint.lo
  CC       libxdgmime_la-xdgmimemagic.lo
  CC       libxdgmime_la-xdgmimeparent.lo
  CCLD     libxdgmime.la
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/xdgmime'
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/xdgmime'
Making all in inotify
make[4]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/inotify'
make  all-am
make[5]: Entering directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/inotify'
  CC       libinotify_la-inotify-kernel.lo
  CC       libinotify_la-inotify-sub.lo
  CC       libinotify_la-inotify-path.lo
  CC       libinotify_la-inotify-missing.lo
  CC       libinotify_la-inotify-helper.lo
  CC       libinotify_la-ginotifyfilemonitor.lo
  CC       libinotify_la-ginotifydirectorymonitor.lo
In file included from ../../gio/gio.h:164,
                 from ../../gio/gunixmounts.h:24,
                 from ../../gio/glocaldirectorymonitor.h:26,
                 from ginotifydirectorymonitor.h:29,
                 from ginotifydirectorymonitor.c:26:
../../gio/glistmodel.h:36: error: redefinition of typedef 'GListModel'
../../gio/giotypes.h:64: note: previous declaration of 'GListModel' was here
In file included from ../../gio/gio.h:165,
                 from ../../gio/gunixmounts.h:24,
                 from ../../gio/glocaldirectorymonitor.h:26,
                 from ginotifydirectorymonitor.h:29,
                 from ginotifydirectorymonitor.c:26:
../../gio/gliststore.h:36: error: redefinition of typedef 'GListStore'
../../gio/giotypes.h:65: note: previous declaration of 'GListStore' was here
make[5]: *** [libinotify_la-ginotifydirectorymonitor.lo] Error 1
make[5]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/inotify'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio/inotify'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0/gio'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c3se/NOBACKUP/users/froslev/src/glib-2.44.0'
make: *** [all] Error 2

您使用的是哪个编译器?我在 gcc-4.2 附带的 Mac OS 10.6.8 上编译 glib-2.44 时遇到了同样的问题。 重新定义 typedef 在 C11 中似乎是合法的,因此切换到支持 C11 的较新编译器为我解决了这个问题(例如 gcc-4.9)。

我不确定为什么这在 CentOS 上特别失败,但 typedef 重新定义是 C11 的一部分并且已经成为 gcc 功能已有一段时间了。

typedef 重新定义的这种特殊用途实际上并不是必需的,因此 GLib 开发人员 rolled back the change