Compile error: only <glib.h> can be included directly

I tried to compile the latest Ardour-2.x today from svn and it ended like so:

In file included from libs/glibmm2/glibmm/containerhandle_shared.h:32:0, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gmem.h:28:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/ustring.h:24:0, from libs/glibmm2/glibmm/containerhandle_shared.h:34, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/ustring.h:25:0, from libs/glibmm2/glibmm/containerhandle_shared.h:34, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gunicode.h:23:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/unicode.h:27:0, from libs/glibmm2/glibmm/ustring.h:26, from libs/glibmm2/glibmm/containerhandle_shared.h:34, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/unicode.h:28:0, from libs/glibmm2/glibmm/ustring.h:26, from libs/glibmm2/glibmm/containerhandle_shared.h:34, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gstrfuncs.h:28:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/unicode.h:29:0, from libs/glibmm2/glibmm/ustring.h:26, from libs/glibmm2/glibmm/containerhandle_shared.h:34, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gunicode.h:23:2: error: #error "Only can be included directly." In file included from libs/glibmm2/glibmm/debug.h:24:0, from libs/glibmm2/glibmm/containerhandle_shared.h:36, from libs/glibmm2/glibmm/arrayhandle.h:24, from libs/glibmm2/glibmm/miscutils.h:24, from libs/pbd/basename.cc:21: /usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only can be included directly." scons: *** [libs/pbd/basename.os] Error 1 scons: building terminated because of errors.

I’m confused. You don’t support versions included with your own software? I’m not being difficult - just sincerely confused.

@audiodef: this is the key quote “Some 3rd party libraries included in the source code for Ardour 2.X requires older versions of the GTK stack to be built.” So if your question is “do you keep the 3rd party libraries included in the ardour2 source tree up to date with respect to newer versions of GTK and other dependencies?” then the answer is currently “no”. Ardour3 does not include most of these libraries any more.

OK, I got it now. I’m sorry I was befuddled. If you include third-party libs, you naturally can’t be expected to be responsible for those libs.

well, to be fair, i think we could be held responsible - its a judgement call. i just decided that its a silly diversion of the limited developer resources that Ardour already has.

OK. Thank you.

Its not really about the versions of GTK. Newer versions of glib enforce the rule that only the <glib.h> header may be included by other code. I’m not totally sure of which version was the first to impose this rule. You can always use SYSLIBS=1 to avoid building the versions included with Ardour 2.X code.

Some 3rd party libraries included in the source code for Ardour 2.X requires older versions of the GTK stack to be built. You can set SYSLIBS=1 as an scons option (this will not try to build them and will just use the existing system versions of these libraries) but we do not support issues with such builds. These issues may or may not be fixed in the near future.

I’m going to to update my DAW to Ubuntu 12.04 (from 10.04). Does that mean I cannot compile Ardour 2.x anymore? What versions of GTK are supported?