是否有必要升级Cygwin中的Glib?

时间:2013-09-13 19:46:41

标签: cygwin glib abiword

我正在尝试在我的Cygwin环境中编译abiword。 我有cygwin 1.7.25。

关于glib的编译失败:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -I/usr/include/fribidi -
I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgsf-1 -I/usr/include/libxml2 
-I/usr/include/wv -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -
I/usr/include/libpng15 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gtk-2.0 -
I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -
I/usr/include/gio-unix-2.0/ -I/usr/include/gtk-unix-print-2.0 -I/usr/include/librsvg-2.0 -Wall -
Wextra -Wsign-compare -Wpointer-arith -Wchar-subscripts -Wwrite-strings -Wmissing-noreturn -
Wunused -Wpointer-arith -Wshadow -g -O2 -MT go-cmd-context.lo -MD -MP -MF .deps/go-cmd-
context.Tpo -c goffice/app/go-cmd-context.c  -DDLL_EXPORT -DPIC -o .libs/go-cmd-context.o
In file included from ./goffice/app/goffice-app.h:25:0,
                 from ./goffice/app/go-cmd-context.h:24,
                 from goffice/app/go-cmd-context-impl.h:4,
                 from goffice/app/go-cmd-context.c:10:
/usr/include/glib-2.0/glib/gmacros.h:35:2: error: #error "Only <glib.h> can be included directly."
goffice/app/go-cmd-context.c: In function ‘go_cmd_context_get_type’:
goffice/app/go-cmd-context.c:147:3: warning: missing initializer [-Wmissing-field-initializers]
goffice/app/go-cmd-context.c:147:3: warning: (near initialization for ‘go_cmd_context_info.class_init’) [-Wmissing-field-initializers]
Makefile:503: recipe for target `go-cmd-context.lo' failed
make[3]: *** [go-cmd-context.lo] Error 1
make[3]: Leaving directory `/home/kingram/src/abiword-2.8.6/goffice-bits'
Makefile:409: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kingram/src/abiword-2.8.6/goffice-bits'
Makefile:670: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kingram/src/abiword-2.8.6'
Makefile:473: recipe for target `all' failed
make: *** [all] Error 2

谷歌搜索产生了一个Redhat错误报告,建议需要Glib 2.31。 我正在考虑从源代码下载和编译最新的glib,因为cygwin似乎没有使用它。 但是,我想对这个选择有所了解,或者听听是否有其他经验。

1 个答案:

答案 0 :(得分:2)

  1. 实际上,Glib 2.31是罪魁祸首;它的标题已更改,因此只有顶级标题可能是#include d,而不是单个类标题。
  2. Cygwin 拥有最新的Glib稳定分支。
  3. 因此,为了使其编译,您需要修复代码中的#include,如错误消息中所示。
  4. 但是,我可以为您省去麻烦:Abiword套餐可从Cygwin Ports获得。