GNOME Bugzilla – Bug 348189
Missing include and configure checks for cairo
Last modified: 2006-10-01 10:22:09 UTC
pager.c in libwnck-2.15.3 uses cairo and gdk_cairo symbols. There's no #include to declare the cairo ones, nor is there any ./configure check for presence of cairo and inclusion of its flags. There's also no ./configure check that gtk has cairo enabled. That means on my machine with cairo installed and with a gtk with cairo disabled, I successfully get through ./configure, and crash during compile: gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/include/startup-notification-1.0 -I/sw/i nclude/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/pango-1.0 -I/usr/X11R6/ include -I/usr/X11R6/include/freetype2 -I/sw/include/gtk-2.0 -I/sw/include/atk-1 .0 -I/sw/lib/gtk-2.0/include -DG_LOG_DOMAIN=\"Wnck\" -I.. -DWNCK_I_KNOW_THIS_IS_ UNSTABLE -DWNCK_LOCALEDIR=\"/sw/share/locale\" -DSN_API_NOT_YET_FROZEN=1 -no-cpp -precomp -I/sw/include -O3 -funroll-loops -fstrict-aliasing -Wall -MT pager.lo - MD -MP -MF .deps/pager.Tpo -c pager.c -fno-common -DPIC -o .libs/pager.o pager.c: In function `draw_window': pager.c:702: error: `cairo_t' undeclared (first use in this function) pager.c:702: error: (Each undeclared identifier is reported only once pager.c:702: error: for each function it appears in.) pager.c:702: error: `cr' undeclared (first use in this function) pager.c:712: warning: implicit declaration of function `gdk_cairo_create' pager.c:713: warning: implicit declaration of function `cairo_rectangle' pager.c:714: warning: implicit declaration of function `cairo_clip' pager.c:720: warning: implicit declaration of function `cairo_set_source_rgba' pager.c:728: warning: implicit declaration of function `cairo_fill' pager.c:765: warning: implicit declaration of function `cairo_save' pager.c:766: warning: implicit declaration of function `gdk_cairo_set_source_pix buf' pager.c:769: warning: implicit declaration of function `cairo_paint_with_alpha' pager.c:770: warning: implicit declaration of function `cairo_restore' pager.c:782: warning: implicit declaration of function `cairo_set_line_width' pager.c:786: warning: implicit declaration of function `cairo_stroke' pager.c:788: warning: implicit declaration of function `cairo_destroy' pager.c: In function `wnck_pager_draw_workspace': pager.c:937: error: `cairo_t' undeclared (first use in this function) pager.c:937: error: `cr' undeclared (first use in this function) pager.c:947: warning: implicit declaration of function `gdk_cairo_set_source_col or' pager.c:1014: warning: implicit declaration of function `cairo_set_source_rgb' make[2]: *** [pager.lo] Error 1
Created attachment 69286 [details] [review] Missing #include for cairo and missing configure checks for cairo and cairo-enabled gtk+
Simply checking for gtk 2.8 should suffice no? Also should be <cairo.h> not "cairo.h" (but doesn't gtk 2.8 include it anyhow?)
I'm not really sure how the #include spaghetti in the gtk headers is arranged, as I'm still in a cairoless gtk-2.6 world:( You're right, gtk 2.8 cannot be built without cairo support IIRC, so "gtk >= 2.8" is good enough to assure cairo. Probably left-over from before I realized just having cairo wasn't sufficient here.
I've updated the gtk+ dep. Thanks!