Qt
  1. Qt
  2. QTBUG-22829

boost 1.48, Qt and [Parse error at "BOOST_JOIN"] error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: P2: Important P2: Important
    • Resolution: Done
    • Affects Version/s: 4.7.3, 4.7.4, 4.8.0, 4.8.1
    • Fix Version/s: 5.0.0
    • Component/s: Build tools: moc
    • Labels:
      None

      Description

      I have large project with the mix of Qt and boost. I keep upgrading both Qt and boost to the latest available production releases. Currently I am on Qt 4.7.3 and boost 1.47. Recently a new boost build, 1.48 was released. When I compiled my project with this new boost release I started to get multiple errors "Parse error at "BOOST_JOIN", pointing to boost/type_traits/detail/has_binary_operator.hp(50)

      Naturally I thought that this is the boost problem, switched back to 1.47 and problem dissappeared. I posted the report on boost. I also found out that that this issue was already discussed in another boost thread and the conclusion was that it is MOCC bug. I received responses to my boost report where it was stated that the maintainer of the boost library definitely points out to a bug in Qt MOC compiler.

      Following are the links to the discussion:

      http://groups.google.com/group/boost-list/browse_thread/thread/212fa3fa2f712206
      http://groups.google.com/group/boost-list/browse_thread/thread/1642b52217e30ff7/313695d3024a0234?show_docid=313695d3024a0234

      Last link suggests workaround for Qt, but it looks to be specific to the software they discuss.

      I believe that it might affect quite a large number of people/projects. I will appreciate if you can suggest a generic workaround to fix this issue.

      Please let me know if I can be of any assistance.

        Issue Links

          Activity

          Hide
          mar-na added a comment -

          Only for info: See also with Qt 4.8.6 + boost 1.57.0 + include <boost/signals2.hpp>

          Show
          mar-na added a comment - Only for info: See also with Qt 4.8.6 + boost 1.57.0 + include <boost/signals2.hpp>
          Hide
          Uwe Kindler added a comment -

          Only for info: See also with Qt 4.8.6 + boost 1.57.0 + include <boost/property_tree/ptree.hpp>

          Show
          Uwe Kindler added a comment - Only for info: See also with Qt 4.8.6 + boost 1.57.0 + include <boost/property_tree/ptree.hpp>
          Hide
          Jan Niklas Hasse added a comment -

          As this seems to be fixed in 5.0.0, can the fix be backported to Qt 4.8.x?

          Show
          Jan Niklas Hasse added a comment - As this seems to be fixed in 5.0.0, can the fix be backported to Qt 4.8.x?
          Hide
          Olivier Goffart (Woboq GmbH) added a comment -

          This is a major change and will never be backported to Qt4

          Until you port your code to Qt5, you can use this work around of wrapping any problematic include within #ifndef Q_MOC_RUN:

          #ifndef Q_MOC_RUN
          #include <boost/python.hpp>
          #endif
          
          Show
          Olivier Goffart (Woboq GmbH) added a comment - This is a major change and will never be backported to Qt4 Until you port your code to Qt5, you can use this work around of wrapping any problematic include within #ifndef Q_MOC_RUN: #ifndef Q_MOC_RUN #include <boost/python.hpp> #endif
          Hide
          Jan Niklas Hasse added a comment -

          I see, thanks for the info. The workaround does the trick

          Show
          Jan Niklas Hasse added a comment - I see, thanks for the info. The workaround does the trick

            People

            • Assignee:
              Olivier Goffart (Woboq GmbH)
              Reporter:
              Michael B
            • Votes:
              16 Vote for this issue
              Watchers:
              28 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: