Search code examples
cygwinglibabiword

Is it necessary to upgrade Glib in Cygwin?


I'm attempting to compile abiword in my Cygwin environment. I have cygwin 1.7.25.

The compile fails regarding 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

A google search produced a Redhat bug report suggesting that Glib 2.31 is required. I'm considering downloading and compiling the latest glib from source as cygwin does not appear to be using it. However, I'd like some insight on this choice or hear if there are some other experiences around this.


Solution

    1. Actually, Glib 2.31 is the culprit; its headers changed so that only the top-level headers may be #included, not the individual class headers.
    2. Cygwin does have the latest stable branch of Glib.
    3. Therefore, in order to get this to compile, you would need to fix the #includes in the code, as indicated in the error messages.
    4. However, I can save you the trouble: Abiword packages are available from Cygwin Ports.