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.

4
  • Do you have a macro named foreach defined that expands to Q_FOREACH?
    – Praetorian
    Jul 10, 2015 at 17:02
  • Did you re-run qmake after adding no_keywords to the CONFIG?
    – MrEricSir
    Jul 10, 2015 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. And the above error is gone. Now I am getting weird errors.
    – user127032
    Aug 28, 2015 at 17:50
  • If you have a new question, the thing to do is to open a new question.
    – MrEricSir
    Aug 28, 2015 at 17:58

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.