Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK, this is driving me nuts. I needed glib-2.28 to build one single package that won't build with later glib, so I eradicated 2.31 and built 2.28, then I built my dependant package, eradicated glib-2.28 and re-built 2.31. After this I went on to successfully build xfce.
However, many programs using glib are now fine at ./configure, but are failing make, and the only common element is glib. The errors are:
error: #error "Only <glib.h> can be included directly."
There's usually the attempted include shown, but it varies depending on the package I'm trying to build. I'm sure there must be a CFLAG or something that needs setting, but I can find nothing.
I've googled it every which way, and whilst I can find possible fixes for building specific programs, nothing that points to the underlying cause to enable a fix across the board. (No fixes for the programs I'm trying to compile, either).
Seems like the problem is that ./configure adds "-DG_DISABLE_SINGLUE_INCLUDES" to CFLAGS of the application being compiled, while some other libs and headers aren't ready for that.
So, in those applications, try to remove this flag from CFLAGS, either in ./configure or elsewhere.
Dirty fix.
...Although, here it gives to understand that such error should appear starting from as early as version glib-2.17. So must make no difference between 2.28/2.31 it seems.
Therefore, from the looks of it, the problem must be the applications using this CFLAGS definition in ./configure and configure.h.
Well, I tried an alternative fix, which was to go through the sources as they fail in make, and replace the includes with #include <glib.h>, then reconfigure and re make. This has allowed certainly one test application (xchat) to successfully build (and works after testing), so for now I'll mark this solved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.