1

I'm trying to resolve this bug and a workaround suggested was to pass -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED to moc.exe.

This question is related to mine. The difference is I want to add a MOC flag in a VS2010 project (VS add-in).

I've tried left click -> Qt Project Setting -> MocOptions and adding -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED

Note my problem occurs using boost 1.53.

3
  • Actually your solution worked for me (I am using Qt 4.8.4 with VS2010 and boost 1.53)
    – c_k
    Mar 15, 2013 at 0:44
  • 1
    Are you sure you rebuilt you whole project after editing MocOptions? Do you use boost in precompiled headers?
    – c_k
    Mar 15, 2013 at 0:49
  • @Corijn, yes I am using boost in the precompiled headers. Is that an issue?
    – andre
    Mar 15, 2013 at 14:22

2 Answers 2

2

The solution has been provided yesterday from here

We need to add -DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION to the moc options too.

1

What you've tried is actually the right solution. However, you need to rebuild your project in order to work around the bug. When DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED is set, it changes the precompilation of your Boost headers. As you stated, you are using boost in precompiled headers. You have to rebuild them as well to fix your problem.

5
  • Thank you so much for you reply but that is not the solution for me. It seems someone updated the post in the first link i gave with the solution. we need to add -DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION when using boost 1.53.
    – andre
    Mar 15, 2013 at 14:59
  • That confuses me. DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED works for me (and I do have Boost 1.53 Rev: 81650 2012-12-01 13:28:55 +0100). But you had to rebuild the precompiled boost headers, right?
    – c_k
    Mar 15, 2013 at 16:18
  • Yes, but rebuild the pre-compiled headers alone did not work. Are you using boost/lexical_cast.hpp in your project?
    – andre
    Mar 15, 2013 at 16:23
  • This is extremely bizarre then. I am using Qt 4.8.2 which version are you using?
    – andre
    Mar 15, 2013 at 16:40
  • I am using 4.8.3. I think I just don't use boost/lexical_cast.hpp in the files which are processed by the MOC compiler.
    – c_k
    Mar 18, 2013 at 8:50

Your Answer

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

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