[Development] [semi-solved] Qt5 moc error in combination with boost

Charley Bay charleyb123 at gmail.com
Tue Jan 22 14:32:45 CET 2013


There's a Qt5 moc error when using Boost, with a work-around.  See:
http://qt-project.org/forums/viewthread/22993

It describes "Boost 1.49", but this work-around also works for "Boost 1.52":

...leads to compile error (Win7/MSVS2010):

C:/Some/Path/3rd/Boost/boost_1_52_0/boost/mpl/if.hpp(131): Error: Macro
argument mismatch.
Project : error PRJ0019: A tool returned an error code from "MOC
..\..\Some\Path\MyClass.hpp"

Work-around, in ALL files that "moc":

//...USING BOOST, MUST GUARD INCLUSION...
#ifndef Q_MOC_RUN
# include <boost/function.hpp>
# include "MyClass.hpp"
#endif // Q_MOC_RUN

We're not using much of Boost 1.52, but we *do* use some of the
"type/traits" stuff (which triggers this error).

There are a few "Boost/moc" errors/bugs reported in
https://bugreports.qt-project.org/, but I couldn't find this one.  Did I
miss it, or should I create a new one?

I'm specifically curious about when this might be fixed, as the work-around
is annoying (I haven't looked into what the fix might be).

Thanks!

--charley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130122/80b4e474/attachment.html>


More information about the Development mailing list