Cloned cairo from git today and tried to build it with: ./autogen.sh \ --prefix=/usr \ --enable-gl \ --enable-xcb make The build fails with GCC 4.7.3: cairo-gobject-enums.c:14:4: error: implicit declaration of function 'g_once_init_enter' cairo-gobject-enums.c:58:7: error: implicit declaration of function 'g_once_init_leave'
FTBFS? Are you on debian? Could you attach your config.log? Apparently, you don't have libglib2.0-dev installed, but configure still decided to enable the cairo-gobject code. Hm. On the other hand, these are all the compiler errors? The compiler did find all the included headers? Which version of gobject is this? Could you try adding "#include <glib.h>" to the beginning of util/cairo-gobject/cairo-gobject-enums.c?
Created attachment 85742 [details] config.log of the build
FTBFS means "Fails to build from source". I am not on debian. I attached my config.log. These are all the compiler errors. I also have warnings. I don't know if the compiler did find all the included headers. I don't know which version of gobject is this. After I added "#include <glib.h>" to the beginning of util/cairo-gobject/cairo-gobject-enums.c, I did a `make` inside util/cairo-gobject. Below are the error messages I have: cairo-gobject-structs.c:57:1: error: implicit declaration of function 'g_once_init_enter' [-Werror=implicit-function-declaration] cairo-gobject-structs.c:57:1: error: implicit declaration of function 'g_once_init_leave' [-Werror=implicit-function-declaration] cairo-gobject-enums.c:14:4: error: implicit declaration of function 'g_once_init_enter' [-Werror=implicit-function-declaration] cairo-gobject-enums.c:58:7: error: implicit declaration of function 'g_once_init_leave' [-Werror=implicit-function-declaration]
Sorry, I thought you were on debian because I never heard FTBFS elsewhere. To figure out your glib version, run 'grep VERSION /usr/lib/glib-2.0/include/glibconfig.h'. Alternatively, pkg-config --modversion glib-2.0 should tell you as well. You need at least glib 2.14 (was released in August 2007) for g_once_init_enter. I think that your glib version is too old, but configure doesn't notice. To forcefully disable this, add --disable-gobject to your ./configure arguments.
(In reply to comment #4) > Sorry, I thought you were on debian because I never heard FTBFS elsewhere. Neither did I ;P My glib version was 2.12.13. I updated to 2.34. It seems this broke my libX11.a, libX11.la, libXext.a and libXext.la. So I rebuilt libx11 and libxext. Now cairo builds without error. Thanks for your help. I think someone should add to configure.ac that cairo requires at least version 2.14 of glib.
commit a8a805b8d9bbbfed9986ecc71e76859a5353730f Author: Uli Schlachter <psychon@znc.in> Date: Fri Sep 13 22:18:08 2013 +0200 cairo-gobject: Require at least glib 2.14 cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions were added in glib 2.14 and thus cairo needs at least this version for its gobject helper functions. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239 Signed-off-by: Uli Schlachter <psychon@znc.in>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.