| Summary: | Build issue: #error "Only <glib.h> can be included directly." | ||
|---|---|---|---|
| Product: | TDE | Reporter: | David C. Rankin <trin> |
| Component: | other (any) | Assignee: | Timothy Pearson <kb9vqf> |
| Status: | RESOLVED FIXED | ||
| Severity: | blocker | CC: | bugwatch, darrella, mutantturkey |
| Priority: | P5 | ||
| Version: | R14.0.0 [Trinity] | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Compiler Version: | TDE Version String: | ||
| Application Version: | Application Name: | ||
| Attachments: |
gtk-qt-engine glib.h patch
glib2 patch for kmplayer |
||
Added "Build issue" to Summary for easier identification and querying. Which version of glib introduces this quirk? On Slackware Current I have glib2 2.28.6 installed. A quick grep of the sources shows numerous "Only <glib.h> can be included directly." messages. Yet I don't see the build failure. Looking at glist.h: #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) #error "Only <glib.h> can be included directly." #endif Those three variable definitions determine whether the error message occurs. Browsing around the web indicates glib2 2.31 is the cutoff for these failures, despite the same error message appearing in earlier versions. Initially I thought we probably needed something like this for each patch: #if GLIB_MAJOR_VERSION > 2 || ( GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 31) #include <glib.h> #else #include <glib/glist.h> #endif Then I thought that because the error messages exist in earlier versions of glib2, we could patch everything without the preprocessor checks and change everything directly. Possibly the early appearance of the error messages means support existed to make such changes but only were enforced in glib2 2.31. With that said, I used your patch as-is and rebuilt gtk-qt-engine in Slackware 13.1, which uses glib2 2.28.6. This is the oldest Slackware release I am supporting. The new package contents are the same as my previous builds. No build errors. Therefore your patch works with previous glib2 releases too. I don't know how far back, however. I suppose we could push the patch as-is and should anyone report breakage with an older glib2, then we update the patch with preprocessor checks. Created attachment 699 [details]
glib2 patch for kmplayer
After searching the sources, there probably are only two apps that need a patch: gtk-qt-engine and kmplayer:
applications/kmplayer/src/npplayer.c:33: #include <glib/gprintf.h>
applications/gtk-qt-engine/src/qt_theme_draw.c:6: #include <glib/glist.h>
Attached is a patch for kmplayer, if needed.
gtk-qt-engine patch pushed to GIT in commit 1525fb2f. kmplayer patch pushed to GIT in commit efeb4d69. We'll keep this report open a while longer in case other such failures occur. Notice:
Anybody building koffice with wv2 support against glib2 >=2.31 will experience a build failure. A header file in wv2 references a glib2 header and needs to be patched. Here is the wv2 patch in case your distro does not have a patched wv2 package:
======================================================================
diff -urN wv2-0.4.2/src/olestream.h wv2-0.4.2.new/src/olestream.h
--- wv2-0.4.2/src/olestream.h 2009-10-31 13:22:43.000000000 -0500
+++ wv2-0.4.2.new/src/olestream.h 2012-07-17 20:56:04.000000000 -0500
@@ -23,7 +23,7 @@
#include "global.h" // U8,... typedefs
#include <stack>
-#include <glib/giochannel.h> // GSeekType
+#include <glib.h> // GSeekType
namespace wvWare {
I have not seen any more of these failures. Closing as resolved. Thanks for reporting! |
Created attachment 692 [details] gtk-qt-engine glib.h patch Upstream glib changes have changed the allowable header inclusion scheme replacing the old '#include <glib/whatever.h>' simply with '#include <glib.h>. This bug will identify the affected header files and collect patches for pushing. The first gtk-qt-engine patch is included for reference. If we can do this with set globally, let me know. We may also need to add preprocessor directive to check glib version to allow dynamic implementation of fixes.