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

8 replies [Last post]
audiodef
User offline. Last seen 5 days 11 hours ago. Offline
Joined: 2009-08-29
Posts:

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.

paul
paul's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 2006-03-16
Posts:

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.

Scary-Hallo
Scary-Hallo's picture
User offline. Last seen 31 weeks 1 day ago. Offline
Joined: 2009-02-13
Posts:

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?

paul
paul's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 2006-03-16
Posts:

Its not really about the versions of GTK. Newer versions of glib enforce the rule that only the 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.

Scary-Hallo
Scary-Hallo's picture
User offline. Last seen 31 weeks 1 day ago. Offline
Joined: 2009-02-13
Posts:

OK. Thank you.

audiodef
User offline. Last seen 5 days 11 hours ago. Offline
Joined: 2009-08-29
Posts:

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

paul
paul's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 2006-03-16
Posts:

@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.

audiodef
User offline. Last seen 5 days 11 hours ago. Offline
Joined: 2009-08-29
Posts:

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.

paul
paul's picture
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 2006-03-16
Posts:

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.