Not able to #include netwm.h and qvarant.h together

Lubos Lunak l.lunak at suse.cz
Tue Apr 13 16:36:56 BST 2004


On Monday 12 of April 2004 17:43, Sandro Giessl wrote:
> Am Sunday 11 April 2004 04:30 schrieb Thiago Macieira:
> > Sandro Giessl wrote:
> > >Hi,
> > >
> > >Today I noticed a strange compile error when including qvariant.h.
> > > First I thought that there is a problem with my fresh qt-copy but
> > > it seems to be a conflict between netwm.h and qvariant.h. I really
> > > don't have an idea what's wrong and how to solve this, help is very
> > > much appreciated.
> >
> > Here's why:
> >
> > netwm.h includes X11/Xlib.h, which has:
> > #define Bool int
>
> Strange. :)
>
> > Subsequently, qvariant.h defines enum QVariant::Type containing an
> > element called Bool. It gets replaced by "int" and then the compiler
> > complains.
> >
> > Solution:
> > #include <fixx11.h>
> > after #include <netwm.h>
>
> Ok, thanks for the info. For some reason I don't have the file
> "fixx11.h"

 fixx11h.h

> installed but in my case it is sufficient to include netwm.h 
> after all other includes.
>
> > I'd go even further and suggest netwm.h include it after it's done
> > including the X11 namespace-dirty headers.

 I was considering that, but I wasn't 100,000% sure the remapping doesn't 
affect something. Moreover some .cpp files #include X11 includes directly, so 
they may need to use fixx11h.h too anyway.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kde-core-devel mailing list