[Interest] Compiler Error from moc_MainWindow.cpp

Andreas Pakulat apaku at gmx.de
Fri Sep 6 19:25:11 CEST 2013


Hi,

On Fri, Sep 6, 2013 at 7:09 PM, Mitchell Verter
<mitchell.verter at gmail.com>wrote:

> Thanks for your response, Thiago.
>
> So your intutiion was correct:  the error is coming from exacty a line
> that says
>
> #define Bool int
>
> However, this line is located in the the X11 libraries, in Xlib.h.
>
> I was using X11 to inject mouse clicks into the application.
>
> I had no problems using Xlib.h when I was using Qt4 but I am having
> problems in Qt5.  Why would this be?  What should I do to rectify it?  I am
> reluctant to start chopping away at X11 header files.
>

Well, with Qt4 you probably got Xlib.h included in some Qt header and Qt
cleaned up all the broken defines that it sets for you. With Qt5 all this
stuff is completely hidden in private headers and plugins that your app
code never include's, now you gotta clean up such stuff yourself.

For this particular case a

#undef Bool

after the include <Xlib.h> should be sufficient. If you use Xlib.h in
multiple places, create a myXlib.h use that everywhere and put the cleanup
in there.

With some grepping you might be able to find where in Qt4 the cleanup
happens and just take that over into your project.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130906/34e4b1a4/attachment.html>


More information about the Interest mailing list