Qt4 + CGAL - Parse error at "BOOST_JOIN"

Mauricio Zambon picture Mauricio Zambon · Mar 16, 2013 · Viewed 12.9k times · Source

I'm getting the error Parse error at "BOOST_JOIN" while trying to compile a code with Qt4 and CGAL. I'm not using Boost directly and I've already searched and tried a bunch of options like -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDEDand -DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. The versions I'm working with are CGAL 4.1.0, Qt 4.8.4_6 and Boost 1.53.0_1, and using CMake to generate the Makefile, in a machine Mac OS 10.8.2. Any ideas of what could be causing that error?

Answer

elegant dice picture elegant dice · Aug 8, 2014

This problem happens in Boost 1.56.0 with QT 4.7.4 (which is quite old now),

Regardless, another quick workaround is to edit the problematic boost header files, and

add to the top:
#ifndef Q_MOC_RUN

add to the bottom:
#endif

This will at least let MOC run without dying.