GLIB header files do not match library version


October 2015.
The FreeBSD logo Image

Let's try to build graphics/gdk-pixbuf2 on FreeBSD:


# make -C /usr/ports/graphics/gdk-pixbuf2 install clean
[...]
checking for GLIB - version >= 2.37.6... *** GLIB header files (version 2.36.3) do not match
*** library (version 2.44.1)
no
configure: error:
*** GLIB 2.37.6 or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.
===> Script "configure" failed unexpectedly.
Please report the problem to gnome@FreeBSD.org [maintainer] and attach the
"/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.32.1/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/gdk-pixbuf2
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/gdk-pixbuf2


# pkg info | grep glib
glib-2.44.1_1 Some useful routines of C programming (current stable version)

Huh? Okay. I was pretty sure 2.44 > 2.37.

Who does that check?


# grep -R 'GLIB header files' *
work/gdk-pixbuf-2.32.1/aclocal.m4: printf("*** GLIB header files (version %d.%d.%d) do not match\n",
work/gdk-pixbuf-2.32.1/configure: printf("*** GLIB header files (version %d.%d.%d) do not match\n",
work/gdk-pixbuf-2.32.1/config.log:| printf("*** GLIB header files (version %d.%d.%d) do not match\n",
work/gdk-pixbuf-2.32.1/configure.libtool.bak: printf("*** GLIB header files (version %d.%d.%d) do not match\n",


# cat work/gdk-pixbuf-2.32.1/aclocal.m4
[...]
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
[...]

Where are those constants defined?


# grep -R -A 2 GLIB_MAJOR_VERSION /usr/local/include/*
/usr/local/include/glib-2.0/glibconfig.h:#define GLIB_MAJOR_VERSION 2
/usr/local/include/glib-2.0/glibconfig.h:#define GLIB_MINOR_VERSION 36
/usr/local/include/glib-2.0/glibconfig.h:#define GLIB_MICRO_VERSION 3

Where does this file come from?


# pkg which /usr/local/include/glib-2.0/glibconfig.h
/usr/local/include/glib-2.0/glibconfig.h was not found in the database

Nowhere.

Did the port even installed it?


# grep glibconfig.h /usr/ports/devel/glib20/pkg-plist
lib/glib-2.0/include/glibconfig.h

No.

Let's delete it and rebuild the port just in case.


# rm /usr/local/include/glib-2.0/glibconfig.h
# make -C /usr/ports/devel/glib20 reinstall clean

Let's try our build again.


# make -C /usr/ports/graphics/gdk-pixbuf2 install clean
[...]
checking for GLIB - version >= 2.37.6... yes (version 2.44.1)
[...]
===> Checking if gdk-pixbuf2 already installed
===> Registering installation for gdk-pixbuf2-2.32.1
Installing gdk-pixbuf2-2.32.1...
===> Cleaning for gdk-pixbuf2-2.32.1

Success!