0

I'm using boost 1.54 and Qt version 5.2.1.

I'm getting the following error when I try to build the package

/usr/include/boost/multi_index/sequenced_index.hpp:927:10: error: 'boost::Q_FOREACH’ has not been declared
 boost::foreach::tag
        ^

/usr/include/boost/multi_index/ordered_index.hpp:1399:10: error: ‘boost::Q_FOREACH’ has not been declared
 boost::foreach::tag)
    ^

Checked the header in sequenced_index.hpp, ordered_index.hpp, they both have foreach_fwd.hpp and foreach.hpp included. I tried including CONFIG += no_keywords in the project file (.pro). But still I'm getting this error. I'm not sure what's the reason.

Sestertius
  • 1,367
  • 1
  • 14
  • 13
  • Do you have a macro named `foreach` defined that expands to `Q_FOREACH`? – Praetorian Jul 10 '15 at 17:02
  • Did you re-run qmake after adding no_keywords to the CONFIG? – MrEricSir Jul 10 '15 at 21:05
  • @MrEricSir: Thanks. I don't get that error anymore but I got a new error `error: expected ‘:’ before ‘slots’;` `error: ‘slots’ does not name a type` `error: ‘signals’ does not name a type` I tried following this [link](http://doc.qt.io/qt-5/signalsandslots.html#using-qt-with-3rd-party-signals-and-slots). And the above error is gone. Now I am getting weird errors. – user127032 Aug 28 '15 at 17:50
  • If you have a new question, the thing to do is to open a new question. – MrEricSir Aug 28 '15 at 17:58

1 Answers1

0

For the record, this problem has been circumvented for the upcoming Boost 1.60 release so that you can let Qt define the macro foreach.

Joaquín M López Muñoz
  • 5,243
  • 1
  • 15
  • 20